fix(router): fix index routes

This commit is contained in:
vsavkin
2016-06-02 11:30:38 -07:00
parent 243612e36d
commit d95f0fd83d
6 changed files with 89 additions and 30 deletions

View File

@ -96,8 +96,7 @@ function findStartingNode(normalizedChange: NormalizedNavigationCommands, urlTre
}
function findUrlSegment(route: ActivatedRoute, urlTree: UrlTree, numberOfDoubleDots: number): UrlSegment {
const segments = (<any>route.urlSegments).value;
const urlSegment = segments[segments.length - 1];
const urlSegment = route.snapshot._lastUrlSegment;
const path = urlTree.pathFromRoot(urlSegment);
if (path.length <= numberOfDoubleDots) {
throw new Error("Invalid number of '../'");