MCPcopy Create free account
hub / github.com/angular/angular / isActive

Method isActive

packages/router/src/router.ts:639–654  ·  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

637 * @see {@link isActive}
638 */
639 isActive(url: string | UrlTree, matchOptions: boolean | Partial<IsActiveMatchOptions>): boolean {
640 let options: IsActiveMatchOptions;
641 if (matchOptions === true) {
642 options = {...exactMatchOptions};
643 } else if (matchOptions === false) {
644 options = {...subsetMatchOptions};
645 } else {
646 options = {...subsetMatchOptions, ...matchOptions};
647 }
648 if (isUrlTree(url)) {
649 return containsTree(this.currentUrlTree, url, options);
650 }
651
652 const urlTree = this.parseUrl(url);
653 return containsTree(this.currentUrlTree, urlTree, options);
654 }
655
656 private removeEmptyProps(params: Params): Params {
657 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