Skip to content

Commit

Permalink
fix(lib): use document token to resolve window object
Browse files Browse the repository at this point in the history
  • Loading branch information
exequiel09 committed Nov 13, 2024
1 parent 34b5906 commit 615b41a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/ngx-fast-lib/src/lib/token/svg-load.strategy.ts
Original file line number Diff line number Diff line change
@@ -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<string>): Observable<string> {
return url$.pipe(switchMap((url) => {
Expand Down

0 comments on commit 615b41a

Please sign in to comment.