From 615b41a3166654a1dbb60468955d30ee9fb7d3f3 Mon Sep 17 00:00:00 2001 From: Exequiel Ceasar Navarrete Date: Wed, 13 Nov 2024 17:09:08 +0800 Subject: [PATCH] fix(lib): use document token to resolve window object --- packages/ngx-fast-lib/src/lib/token/svg-load.strategy.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) => {