Reputation: 7207
To use Material icon for Angular, <mat-icon>
is used with the name of the icon:
<mat-icon>check</mat-icon>
And icons can be found here: https://material.io/tools/icons/?style=baseline
Now the problem is this icon-set lacks so many icons. For example, Instagram icon can't be found there.
In these situations one way is to fall back to icon-fonts and include more icon fonts in your HTML page, and use the old <i>
element for that purpose.
But that's code smell, because your codebase now has two approaches for one purpose.
How do you solve this problem? How do you incorporate an icon that doesn't exist in Google Material for Angular? How do you extend Google Material icons?
Upvotes: 1
Views: 3345
Reputation: 1597
you can use the google-icon npm package in your own project.
look at the link.
Upvotes: 0
Reputation: 748
If you check the API given from Angular Material you could use MatIconRegistry
(ref: https://material.angular.io/components/icon/api#MatIconRegistry) to add your own icons to be used by the same notation (using mat-icon
).
Upvotes: 2