Open azerafati opened 2 years ago
Hii, if anyone not working on it then I would like to contribute I am new and want to contribute to the community.
Please reply.
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.
You can find more details about the feature request process in our documentation.
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
Description
When we use a
mat-icon
with a SVG registered throughMatIconRegistry
,mat-icon
shows the SVG but won't update itself if we change it later, meaning we add a new SVG with the same name.I believe the problem goes back to this line. https://github.com/angular/components/blob/6d8693d0b66e2835795858544a5dce594e76fb6f/src/material/icon/icon.ts#L441
Which seems logical to avoid performance issues. Probably we need to provide a way to reload the icons if we ever wanted to. I did this hack and it's working. Check out the second icon in the example stackblitz.
I would suggest adding a method to
MatIcon
component:Reproduction
Register the icon after it has been rendered. You can check out an example here on this stackblitz
Expected Behavior
When doing
iconRegistry.addSvgIconLiteral('svg-icon', ...);
it is expcted to see the already renderedmat-icon
withsvgIcon="svg-icon"
to get updated and show the newly added SVG iniconRegistry
.Actual Behavior
mat-icon
component won't show the new SVG.Environment