Route snapshots are typed as non-optional, but we found a situation where it was undefined. Looking at the Angular source code, it seems like indeed snapshots can be undefined but they have been declared with a definite assignment assertion: https://github.com/angular/angular/blob/17.3.0/packages/router/src/router_state.ts#L231
14 lines
661 B
Diff
14 lines
661 B
Diff
diff --git a/node_modules/@angular/router/index.d.ts b/node_modules/@angular/router/index.d.ts
|
|
index b8d7cc8..6511edf 100755
|
|
--- a/node_modules/@angular/router/index.d.ts
|
|
+++ b/node_modules/@angular/router/index.d.ts
|
|
@@ -58,7 +58,7 @@ export declare class ActivatedRoute {
|
|
/** The component of the route, a constant. */
|
|
component: Type<any> | null;
|
|
/** The current snapshot of this route */
|
|
- snapshot: ActivatedRouteSnapshot;
|
|
+ snapshot?: ActivatedRouteSnapshot;
|
|
/** An Observable of the resolved route title */
|
|
readonly title: Observable<string | undefined>;
|
|
/** An observable of the URL segments matched by this route. */
|