1.0.0 • Published 6 years ago

@team23/ng-icon-component v1.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

Icon Module

Include in Project

AppModule

providers: [
    ...,
    IconModule.forRoot()
]

AppComponent

Initialize Icon Service in Root Component

  • define getter for icon ID
  • (optional) define all available Icon Sizes
  • (optionsl) define icon src (default: 'assets/images/icons/symbol/icons-symbols.svg')
    this.iconService
        .setIdFunction((component: AbstractIconModel) => {
            return `icon-${component.size}-px-color-${component.name}`;
        })
        .setIconSizes([16, 20, 24])
        .setIconSrc('assets/images/icons/symbol/icons-symbols.svg');

Every other Module that needs an icon to display

Similar to the SharedModule the IconModule needs to be included in every Module that uses the IconComponent

providers: [
    ...,
    IconModule
]

Usage

<t23-icon [name]="name" [size]="size" [src]="src"></t23-icon>