diff --git a/packages/router/src/router_state.ts b/packages/router/src/router_state.ts index 00deff77de2c..68b577991219 100644 --- a/packages/router/src/router_state.ts +++ b/packages/router/src/router_state.ts @@ -122,7 +122,7 @@ export function createEmptyStateSnapshot(rootComponent: Type | null): Route * * @publicApi */ -export class ActivatedRoute { +export class ActivatedRoute { /** The current snapshot of this route */ snapshot!: ActivatedRouteSnapshot; /** @internal */ @@ -146,7 +146,7 @@ export class ActivatedRoute { /** An observable of the URL fragment shared by all the routes. */ public fragment: Observable; /** An observable of the static and resolved data of this route. */ - public data: Observable; + public data: Observable; /** @internal */ constructor( @@ -159,7 +159,7 @@ export class ActivatedRoute { /** @internal */ public fragmentSubject: BehaviorSubject, /** @internal */ - public dataSubject: BehaviorSubject, + public dataSubject: BehaviorSubject, /** The outlet name of the route, a constant. */ public outlet: string, /** The component of the route, a constant. */ @@ -167,7 +167,7 @@ export class ActivatedRoute { futureSnapshot: ActivatedRouteSnapshot, ) { this._futureSnapshot = futureSnapshot; - this.title = this.dataSubject?.pipe(map((d: Data) => d[RouteTitleKey])) ?? of(undefined); + this.title = this.dataSubject?.pipe(map((d: T) => d[RouteTitleKey])) ?? of(undefined); // TODO(atscott): Verify that these can be changed to `.asObservable()` with TGP. this.url = urlSubject; this.params = paramsSubject; @@ -318,7 +318,7 @@ export function getInherited( * * @publicApi */ -export class ActivatedRouteSnapshot { +export class ActivatedRouteSnapshot { /** The configuration used to match this route **/ public readonly routeConfig: Route | null; /** @internal */ @@ -368,7 +368,7 @@ export class ActivatedRouteSnapshot { /** The URL fragment shared by all the routes */ public fragment: string | null, /** The static and resolved data of this route */ - public data: Data, + public data: T, /** The outlet name of the route */ public outlet: string, /** The component of the route */