( url: string | UrlTree, router: Router, matchOptions?: Partial<IsActiveMatchOptions>, )
| 117 | * @publicApi 21.1 |
| 118 | */ |
| 119 | export function isActive( |
| 120 | url: string | UrlTree, |
| 121 | router: Router, |
| 122 | matchOptions?: Partial<IsActiveMatchOptions>, |
| 123 | ): Signal<boolean> { |
| 124 | const urlTree = url instanceof UrlTree ? url : router.parseUrl(url); |
| 125 | return computed(() => |
| 126 | containsTree(router.lastSuccessfulNavigation()?.finalUrl ?? new UrlTree(), urlTree, { |
| 127 | ...subsetMatchOptions, |
| 128 | ...matchOptions, |
| 129 | }), |
| 130 | ); |
| 131 | } |
| 132 | |
| 133 | export function containsTree( |
| 134 | container: UrlTree, |
no test coverage detected
searching dependent graphs…