Skip to content

Commit

Permalink
Merge pull request #118 from tspmelo/fix-svg-icons-config-ref
Browse files Browse the repository at this point in the history
fix: allow referring to SVG_ICONS_CONFIG before being defined
  • Loading branch information
NetanelBasal authored Jan 28, 2023
2 parents 87ba424 + a3df716 commit 19ae037
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/ngneat/svg-icon/src/lib/registry.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DOCUMENT } from '@angular/common';
import { inject, Inject, Injectable, Injector } from '@angular/core';
import { forwardRef, inject, Inject, Injectable } from '@angular/core';

import { SVG_CONFIG, SVG_ICONS_CONFIG, SvgIconType } from './providers';

Expand All @@ -14,7 +14,7 @@ export class SvgIconRegistry {
private svgMap = new Map<string, SvgIcon>();
private document = inject(DOCUMENT);

constructor(@Inject(SVG_ICONS_CONFIG) config: SVG_CONFIG) {
constructor(@Inject(forwardRef(() => SVG_ICONS_CONFIG)) config: SVG_CONFIG) {
if (config?.icons) {
this.register(config.icons);
}
Expand Down

0 comments on commit 19ae037

Please sign in to comment.