Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit c7f35ab

Browse files
committed
feat(nav-list-item): support path params, query params, and fragments in paths
- extra error checking
1 parent 6205d5d commit c7f35ab

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

projects/dev/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devintent/dev",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
44
"description": "Application Development Library",
55
"keywords": [
66
"material", "design", "angular", "material design", "components"
@@ -18,7 +18,7 @@
1818
"@angular/cdk": "^9.0.0 || ^10.0.0-next.0 || ^10.0.0-rc.0",
1919
"@angular/common": "^9.0.0 || ^10.0.0-next.0 || ^10.0.0-rc.0",
2020
"@angular/core": "^9.0.0 || ^10.0.0-next.0 || ^10.0.0-rc.0",
21-
"@angular/flex-layout": "^9.0.0-beta.29 || ^9.0.0",
21+
"@angular/flex-layout": "^9.0.0-beta.29 || ^9.0.0 || ^10.0.0-beta.0 || ^10.0.0",
2222
"@angular/material": "^9.0.0 || ^10.0.0-next.0 || ^10.0.0-rc.0"
2323
}
2424
}

projects/dev/src/lib/nav-list-item/nav-list-item.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ export class NavListItemComponent implements OnInit, OnDestroy {
4848
}
4949

5050
onItemSelected(item: NestedNavItem) {
51-
if (!item.children || !item.children.length) {
52-
this.router.navigate([item.path]);
51+
if ((!item.children || !item.children.length) && item && item.path) {
52+
this.router.navigateByUrl(item.path);
5353
this.navExpansionService.closeNav();
5454
}
55-
if (item.children && item.children.length) {
55+
if (item && item.children && item.children.length) {
5656
this.expanded = !this.expanded;
5757
}
5858
}

0 commit comments

Comments
 (0)