From 2fdb39e60ac7101ffc1af5a1a540512cb391a647 Mon Sep 17 00:00:00 2001 From: vsavkin Date: Thu, 28 Jul 2016 16:39:01 -0700 Subject: [PATCH] feat(router): activateroute should expose its route config --- modules/@angular/router/src/router_state.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/@angular/router/src/router_state.ts b/modules/@angular/router/src/router_state.ts index 540a01e336..553da3136e 100644 --- a/modules/@angular/router/src/router_state.ts +++ b/modules/@angular/router/src/router_state.ts @@ -105,6 +105,8 @@ export class ActivatedRoute { this._futureSnapshot = futureSnapshot; } + get routeConfig(): Route { return this._futureSnapshot.routeConfig; } + toString(): string { return this.snapshot ? this.snapshot.toString() : `Future(${this._futureSnapshot})`; } @@ -179,6 +181,8 @@ export class ActivatedRouteSnapshot { this._resolve = resolve; } + get routeConfig(): Route { return this._routeConfig; } + toString(): string { const url = this.url.map(s => s.toString()).join('/'); const matched = this._routeConfig ? this._routeConfig.path : '';