refactor(router): remove deprecated apis (#10658)

This commit is contained in:
Victor Savkin
2016-08-16 13:40:28 -07:00
committed by vikerman
parent f7ff6c5a12
commit 24e280a21a
22 changed files with 963 additions and 1589 deletions

View File

@ -182,8 +182,7 @@ function match(
segmentGroup: UrlSegmentGroup, route: Route, segments: UrlSegment[],
parent: ActivatedRouteSnapshot) {
if (route.path === '') {
if ((route.terminal || route.pathMatch === 'full') &&
(segmentGroup.hasChildren() || segments.length > 0)) {
if (route.pathMatch === 'full' && (segmentGroup.hasChildren() || segments.length > 0)) {
throw new NoMatch();
} else {
const params = parent ? parent.params : {};
@ -213,7 +212,7 @@ function match(
currentIndex++;
}
if ((route.terminal || route.pathMatch === 'full') &&
if (route.pathMatch === 'full' &&
(segmentGroup.hasChildren() || currentIndex < segments.length)) {
throw new NoMatch();
}
@ -334,8 +333,7 @@ function containsEmptyPathMatches(
function emptyPathMatch(
segmentGroup: UrlSegmentGroup, slicedSegments: UrlSegment[], r: Route): boolean {
if ((segmentGroup.hasChildren() || slicedSegments.length > 0) &&
(r.terminal || r.pathMatch === 'full'))
if ((segmentGroup.hasChildren() || slicedSegments.length > 0) && r.pathMatch === 'full')
return false;
return r.path === '' && r.redirectTo === undefined;
}