diff --git a/packages/ngx-fast-lib/src/lib/token/svg-load.strategy.ts b/packages/ngx-fast-lib/src/lib/token/svg-load.strategy.ts index 62f76f8..ad8697a 100644 --- a/packages/ngx-fast-lib/src/lib/token/svg-load.strategy.ts +++ b/packages/ngx-fast-lib/src/lib/token/svg-load.strategy.ts @@ -1,11 +1,13 @@ import { from, Observable, of, switchMap } from 'rxjs'; import { getZoneUnPatchedApi } from '../internal/get-zone-unpatched-api'; import { SvgLoadStrategy } from './svg-load.strategy.model'; -import { Injectable } from '@angular/core'; +import { DOCUMENT } from '@angular/common'; +import { inject, Injectable } from '@angular/core'; @Injectable() export class SvgLoadStrategyImpl implements SvgLoadStrategy { - fetch = getZoneUnPatchedApi('fetch', window as any); + document = inject(DOCUMENT); + fetch = getZoneUnPatchedApi('fetch', this.document.defaultView as any); load(url$: Observable): Observable { return url$.pipe(switchMap((url) => {