diff --git a/projects/ngneat/svg-icon/src/lib/registry.ts b/projects/ngneat/svg-icon/src/lib/registry.ts index 0ea81bb..26705c4 100644 --- a/projects/ngneat/svg-icon/src/lib/registry.ts +++ b/projects/ngneat/svg-icon/src/lib/registry.ts @@ -1,5 +1,5 @@ import { DOCUMENT } from '@angular/common'; -import { Inject, inject, Injectable } from '@angular/core'; +import { Inject, Injectable, Injector } from '@angular/core'; import { SVG_CONFIG, SVG_ICONS_CONFIG, SvgIconType } from './types'; @@ -12,9 +12,11 @@ class SvgIcon { @Injectable({ providedIn: 'root' }) export class SvgIconRegistry { private readonly svgMap = new Map(); - private readonly document: Document = inject(DOCUMENT); + private readonly document: Document; + + constructor(injector: Injector, @Inject(SVG_ICONS_CONFIG) config: SVG_CONFIG) { + this.document = injector.get(DOCUMENT); - constructor(@Inject(SVG_ICONS_CONFIG) config: SVG_CONFIG) { if (config.icons) { this.register(config.icons); }