feat(animations): introduce routeable animation support
This commit is contained in:
@ -36,7 +36,7 @@ import {PRIMARY_OUTLET} from '../shared';
|
||||
*
|
||||
* @stable
|
||||
*/
|
||||
@Directive({selector: 'router-outlet'})
|
||||
@Directive({selector: 'router-outlet', exportAs: 'outlet'})
|
||||
export class RouterOutlet implements OnDestroy, OnInit {
|
||||
private activated: ComponentRef<any>|null = null;
|
||||
private _activatedRoute: ActivatedRoute|null = null;
|
||||
@ -89,6 +89,13 @@ export class RouterOutlet implements OnDestroy, OnInit {
|
||||
return this._activatedRoute as ActivatedRoute;
|
||||
}
|
||||
|
||||
get activatedRouteData() {
|
||||
if (this._activatedRoute) {
|
||||
return this._activatedRoute.snapshot.data;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when the `RouteReuseStrategy` instructs to detach the subtree
|
||||
*/
|
||||
@ -155,4 +162,4 @@ class OutletInjector implements Injector {
|
||||
|
||||
return this.parent.get(token, notFoundValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user