Skip to content

Commit 24e280a

Browse files
vsavkinvikerman
authored andcommitted
refactor(router): remove deprecated apis (angular#10658)
1 parent f7ff6c5 commit 24e280a

File tree

22 files changed

+1008
-1634
lines changed

22 files changed

+1008
-1634
lines changed

modules/@angular/router/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@
77
*/
88

99

10-
export {ExtraOptions, provideRouterConfig, provideRoutes} from './src/common_router_providers';
11-
export {Data, LoadChildren, LoadChildrenCallback, ResolveData, Route, RouterConfig, Routes} from './src/config';
10+
export {Data, LoadChildren, LoadChildrenCallback, ResolveData, Route, Routes} from './src/config';
1211
export {RouterLink, RouterLinkWithHref} from './src/directives/router_link';
1312
export {RouterLinkActive} from './src/directives/router_link_active';
1413
export {RouterOutlet} from './src/directives/router_outlet';
1514
export {CanActivate, CanActivateChild, CanDeactivate, CanLoad, Resolve} from './src/interfaces';
1615
export {Event, NavigationCancel, NavigationEnd, NavigationError, NavigationExtras, NavigationStart, Router, RoutesRecognized} from './src/router';
17-
export {ROUTER_DIRECTIVES, RouterModule} from './src/router_module';
16+
export {ExtraOptions, ROUTER_DIRECTIVES, RouterModule, provideRoutes} from './src/router_module';
1817
export {RouterOutletMap} from './src/router_outlet_map';
19-
export {provideRouter} from './src/router_providers';
2018
export {ActivatedRoute, ActivatedRouteSnapshot, RouterState, RouterStateSnapshot} from './src/router_state';
2119
export {PRIMARY_OUTLET, Params} from './src/shared';
2220
export {DefaultUrlSerializer, UrlSegment, UrlSerializer, UrlTree} from './src/url_tree';

modules/@angular/router/src/apply_redirects.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,7 @@ function match(segmentGroup: UrlSegmentGroup, route: Route, segments: UrlSegment
285285
const noMatch =
286286
{matched: false, consumedSegments: <any[]>[], lastChild: 0, positionalParamSegments: {}};
287287
if (route.path === '') {
288-
if ((route.terminal || route.pathMatch === 'full') &&
289-
(segmentGroup.hasChildren() || segments.length > 0)) {
288+
if ((route.pathMatch === 'full') && (segmentGroup.hasChildren() || segments.length > 0)) {
290289
return {matched: false, consumedSegments: [], lastChild: 0, positionalParamSegments: {}};
291290
} else {
292291
return {matched: true, consumedSegments: [], lastChild: 0, positionalParamSegments: {}};
@@ -315,7 +314,8 @@ function match(segmentGroup: UrlSegmentGroup, route: Route, segments: UrlSegment
315314
currentIndex++;
316315
}
317316

318-
if (route.terminal && (segmentGroup.hasChildren() || currentIndex < segments.length)) {
317+
if (route.pathMatch === 'full' &&
318+
(segmentGroup.hasChildren() || currentIndex < segments.length)) {
319319
return {matched: false, consumedSegments: [], lastChild: 0, positionalParamSegments: {}};
320320
}
321321

@@ -434,8 +434,7 @@ function containsEmptyPathRedirects(
434434

435435
function emptyPathRedirect(
436436
segmentGroup: UrlSegmentGroup, slicedSegments: UrlSegment[], r: Route): boolean {
437-
if ((segmentGroup.hasChildren() || slicedSegments.length > 0) &&
438-
(r.terminal || r.pathMatch === 'full'))
437+
if ((segmentGroup.hasChildren() || slicedSegments.length > 0) && r.pathMatch === 'full')
439438
return false;
440439
return r.path === '' && r.redirectTo !== undefined;
441440
}

modules/@angular/router/src/common_router_providers.ts

Lines changed: 0 additions & 156 deletions
This file was deleted.

0 commit comments

Comments
 (0)