Browse Source
refactor: use default value for url paramater
pull/4663/head
Levent Arman Özak
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
npm/ng-packs/packages/core/src/lib/utils/route-utils.ts
|
|
|
@ -17,9 +17,9 @@ export function findRoute(routes: RoutesService, path: string): TreeNode<ABP.Rou |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
export function getRoutePath(router: Router, url?: string) { |
|
|
|
export function getRoutePath(router: Router, url = router.url) { |
|
|
|
const emptyGroup = { segments: [] } as UrlSegmentGroup; |
|
|
|
const primaryGroup = router.parseUrl(url || router.url).root.children[PRIMARY_OUTLET]; |
|
|
|
const primaryGroup = router.parseUrl(url).root.children[PRIMARY_OUTLET]; |
|
|
|
|
|
|
|
return '/' + (primaryGroup || emptyGroup).segments.map(({ path }) => path).join('/'); |
|
|
|
} |
|
|
|
|