feat(router): activateroute should expose its route config
This commit is contained in:
parent
43c71ae103
commit
2fdb39e60a
|
@ -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 : '';
|
||||||
|
|
Loading…
Reference in New Issue