diff --git a/projects/design-angular-kit/src/lib/components/utils/icon/icon.component.ts b/projects/design-angular-kit/src/lib/components/utils/icon/icon.component.ts index a4cb61a8..84479d2d 100644 --- a/projects/design-angular-kit/src/lib/components/utils/icon/icon.component.ts +++ b/projects/design-angular-kit/src/lib/components/utils/icon/icon.component.ts @@ -1,6 +1,7 @@ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Inject, Input } from '@angular/core'; import { IconColor, IconName, IconSize } from '../../../interfaces/icon'; import { BooleanInput, isTrueBooleanInput } from '../../../utils/boolean-input'; +import { DESIGN_ANGULAR_KIT_CONFIG, DesignAngularKitConfig } from '../../../design-angular-kit-config'; @Component({ selector: 'it-icon[name]', @@ -38,7 +39,7 @@ export class IconComponent { * Return the icon href */ get iconHref(): string { - return `./bootstrap-italia/dist/svg/sprites.svg#it-${this.name}`; + return `${this.config.iconHref}#it-${this.name}`; } /** @@ -61,4 +62,8 @@ export class IconComponent { return iconClass; } + constructor( + @Inject(DESIGN_ANGULAR_KIT_CONFIG) private readonly config: DesignAngularKitConfig + ) { + } } diff --git a/src/app/icon/icon-index/icon-index.component.html b/src/app/icon/icon-index/icon-index.component.html index c53c2fd1..c9206115 100644 --- a/src/app/icon/icon-index/icon-index.component.html +++ b/src/app/icon/icon-index/icon-index.component.html @@ -7,6 +7,11 @@
E' possibile configurare il path href del componente attraverso la configurazione iniziale della libreria.
+ +