feat(router): activateroute should expose its route config

This commit is contained in:
vsavkin 2016-07-28 16:39:01 -07:00
parent 43c71ae103
commit 2fdb39e60a
1 changed files with 4 additions and 0 deletions

View File

@ -105,6 +105,8 @@ export class ActivatedRoute {
this._futureSnapshot = futureSnapshot; this._futureSnapshot = futureSnapshot;
} }
get routeConfig(): Route { return this._futureSnapshot.routeConfig; }
toString(): string { toString(): string {
return this.snapshot ? this.snapshot.toString() : `Future(${this._futureSnapshot})`; return this.snapshot ? this.snapshot.toString() : `Future(${this._futureSnapshot})`;
} }
@ -179,6 +181,8 @@ export class ActivatedRouteSnapshot {
this._resolve = resolve; this._resolve = resolve;
} }
get routeConfig(): Route { return this._routeConfig; }
toString(): string { toString(): string {
const url = this.url.map(s => s.toString()).join('/'); const url = this.url.map(s => s.toString()).join('/');
const matched = this._routeConfig ? this._routeConfig.path : ''; const matched = this._routeConfig ? this._routeConfig.path : '';