Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions goldens/public-api/router/index.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ export interface ComponentInputBindingOptions {
unmatchedInputBehavior?: 'alwaysUndefined' | 'undefinedIfStale';
}

// @public
export function containsTree(container: UrlTree, containee: UrlTree, options: IsActiveMatchOptions): boolean;

// @public
export function convertToParamMap(params: Params): ParamMap;

Expand Down
1 change: 1 addition & 0 deletions packages/router/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export {
UrlSegmentGroup,
UrlSerializer,
UrlTree,
containsTree,
} from './url_tree';
export {
mapToCanActivate,
Expand Down
9 changes: 9 additions & 0 deletions packages/router/src/url_tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ export function isActive(
);
}

/**
* Determines if a `UrlTree` is contained within another `UrlTree` based on the provided matching options.
*
* @param container The outer or reference `UrlTree`.
* @param containee The target `UrlTree` to test against the container.
* @param options Matching rules for paths, matrix parameters, query parameters, and fragments.
*
* @publicApi
*/
export function containsTree(
container: UrlTree,
containee: UrlTree,
Expand Down
Loading