You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This package allows you to use the Feather Icons in your angular applications. The icons are designed by Cole Bemis.
Import only the icons that you need.
2. Generate a module to host the icons you'll import
ng generate module icons
3. Import assets
You need to import:
FeatherModule, as it contains the <i-feather> component
The SVGs that you need
We put this in IconsModule for modularity. See example below:
file: icon.module.ts
import{NgModule}from'@angular/core';import{FeatherModule}from'angular-feather';import{Camera,Heart,Github}from'angular-feather/icons';// Select some icons (use an object, not an array)consticons={
Camera,
Heart,
Github
};
@NgModule({imports: [FeatherModule.pick(icons)],exports: [FeatherModule]})exportclassIconsModule{}// NOTES:// 1. We add FeatherModule to the 'exports', since the <i-feather> component will be used in templates of parent module// 2. Don't forget to pick some icons using FeatherModule.pick({ ... })
3. Use it in template
After importing the IconsModule in your feature or shared module, use the icons as follows:
However, keep in mind that by doing this, all icons will end up in your application bundle. While this may not be much of an issue for prototyping, it is not recommended for any application that you plan to release.