feat(animations): introduce routeable animation support

This commit is contained in:
Matias Niemelä
2017-05-19 11:50:33 -07:00
parent b10029c18b
commit f1a9e3c1bb
4 changed files with 372 additions and 3 deletions

View File

@ -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);
}
}
}