Skip to content

Commit

Permalink
fix(router): remove assertInInjectionContext check for v15 compatibil…
Browse files Browse the repository at this point in the history
…ity (#461)
  • Loading branch information
brandonroberts authored Jun 17, 2023
1 parent 2966d73 commit 27a52e1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/router/src/lib/inject-load.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Injector, assertInInjectionContext, inject } from '@angular/core';
import { Injector, inject } from '@angular/core';
import { ActivatedRoute, Data } from '@angular/router';
import { Observable, map } from 'rxjs';

Expand All @@ -7,8 +7,6 @@ import { PageServerLoad } from './route-types';
export function injectLoad<
T extends (pageServerLoad: PageServerLoad) => Promise<any>
>(options?: { injector?: Injector }): Observable<Awaited<ReturnType<T>>> {
!options?.injector && assertInInjectionContext(injectLoad);

const injector = options?.injector ?? inject(Injector);
const route = injector.get(ActivatedRoute);

Expand Down

0 comments on commit 27a52e1

Please sign in to comment.