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

Method isCurrentPathEqualTo

packages/common/src/location/location.ts:129–131  ·  view source on GitHub ↗

* Normalizes the given path and compares to the current normalized path. * * @param path The given URL path. * @param query Query parameters. * * @returns True if the given URL path is equal to the current normalized path, false * otherwise.

(path: string, query: string = '')

Source from the content-addressed store, hash-verified

127 * otherwise.
128 */
129 isCurrentPathEqualTo(path: string, query: string = ''): boolean {
130 return this.path() == this.normalize(path + normalizeQueryParams(query));
131 }
132
133 /**
134 * Normalizes a URL path by stripping any trailing slashes.

Callers 3

setBrowserUrlMethod · 0.45
navigateMethod · 0.45
handleNavigateMethod · 0.45

Implementers 1

SpyLocationpackages/common/testing/src/location_m

Calls 3

pathMethod · 0.95
normalizeMethod · 0.95
normalizeQueryParamsFunction · 0.90

Tested by

no test coverage detected