feat(router): implement CandDeactivate

This commit is contained in:
vsavkin
2016-06-02 14:44:57 -07:00
parent 1914847e72
commit ab958598d7
9 changed files with 132 additions and 34 deletions

View File

@ -13,7 +13,11 @@ export class RouterOutlet {
}
get isActivated(): boolean { return !!this.activated; }
get component(): Object {
if (!this.activated) throw new Error("Outlet is not activated");
return this.activated.instance;
}
deactivate(): void {
if (this.activated) {
this.activated.destroy();