Skip to content

Extending of mdIcon source definition (for strings) #3132

@maku

Description

@maku

Bug, feature request, or proposal:

Extending of mdIcon source definition (for inlined svg strings)

What is the expected behavior?

const iconAsSvg: string = '<svg>...</svg>'
mdIconRegistry.addSvgIcon('myicon', iconAsSvg);

or reference the svg string directly in md-icon:

<md-icon  [svgIconSrc]="iconAsSvg"></md-icon>

What is the current behavior?

Registering for svg's works only with an url:

mdIconRegistry.addSvgIcon(iconName: string, url: SafeResourceUrl): this

So you would be more flexible to provide svg resources (e.g. for libs etc.)

Metadata

Metadata

Assignees

Labels

P4A relatively minor issue that is not relevant to core functionsfeatureThis issue represents a new feature or feature request rather than a bug or bug fixhelp wantedThe team would appreciate a PR from the community to address this issueneeds: discussionFurther discussion with the team is needed before proceeding

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions