MCPcopy Index your code
hub / github.com/angular/angular / isActive

Function isActive

packages/router/src/url_tree.ts:119–131  ·  view source on GitHub ↗
(
  url: string | UrlTree,
  router: Router,
  matchOptions?: Partial<IsActiveMatchOptions>,
)

Source from the content-addressed store, hash-verified

117 * @publicApi 21.1
118 */
119export 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
133export function containsTree(
134 container: UrlTree,

Callers 3

url_tree.spec.tsFile · 0.90
isLinkActiveMethod · 0.90

Calls 4

computedFunction · 0.90
containsTreeFunction · 0.85
parseUrlMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…