Skip to content

Commit

Permalink
fix: replace the inject function with injector.get
Browse files Browse the repository at this point in the history
  • Loading branch information
arturovt committed May 16, 2021
1 parent 8a2730f commit 0cb3882
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 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 } from '@angular/core';
import { Inject, Injectable, Injector } from '@angular/core';

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

Expand All @@ -12,9 +12,11 @@ class SvgIcon {
@Injectable({ providedIn: 'root' })
export class SvgIconRegistry {
private readonly svgMap = new Map<string, SvgIcon>();
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);
}
Expand Down

0 comments on commit 0cb3882

Please sign in to comment.