refactor(router): RouteData as a type
BREAKING CHANGE The ROUTE_DATA token has been removed and replaced with a type RouteData, allowing a type injection like we do with RouteParams. Before: constructor(routeParams: RouteParams, @Inject(ROUTE_DATA) routeData) { let id = routeParams.get('id'); let name = ROUTE_DATA.name; } After: constructor(routeParams: RouteParams, routeData: RouteData) { let id = routeParams.get('id'); let name = routeData.get('name'); } Fixes #4392 Closes #4428
This commit is contained in:
@ -7,7 +7,7 @@ export class AsyncRouteHandler implements RouteHandler {
|
||||
_resolvedComponent: Promise<any> = null;
|
||||
componentType: Type;
|
||||
|
||||
constructor(private _loader: Function, public data?: Object) {}
|
||||
constructor(private _loader: Function, public data?: {[key: string]: any}) {}
|
||||
|
||||
resolveComponentType(): Promise<any> {
|
||||
if (isPresent(this._resolvedComponent)) {
|
||||
|
Reference in New Issue
Block a user