MCPcopy
hub / github.com/angular/angular / isActive

Method isActive

packages/router/src/router.ts:629–644  ·  view source on GitHub ↗

* @deprecated 21.1 - Use the `isActive` function instead. * @see isActive

(url: string | UrlTree, matchOptions: boolean | Partial<IsActiveMatchOptions>)

Source from the content-addressed store, hash-verified

627 * @see {@link isActive}
628 */
629 isActive(url: string | UrlTree, matchOptions: boolean | Partial<IsActiveMatchOptions>): boolean {
630 let options: IsActiveMatchOptions;
631 if (matchOptions === true) {
632 options = {...exactMatchOptions};
633 } else if (matchOptions === false) {
634 options = {...subsetMatchOptions};
635 } else {
636 options = {...subsetMatchOptions, ...matchOptions};
637 }
638 if (isUrlTree(url)) {
639 return containsTree(this.currentUrlTree, url, options);
640 }
641
642 const urlTree = this.parseUrl(url);
643 return containsTree(this.currentUrlTree, urlTree, options);
644 }
645
646 private removeEmptyProps(params: Params): Params {
647 return Object.entries(params).reduce((result: Params, [key, value]: [string, any]) => {

Callers

nothing calls this directly

Calls 3

parseUrlMethod · 0.95
isUrlTreeFunction · 0.90
containsTreeFunction · 0.90

Tested by

no test coverage detected