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

Method path

packages/common/upgrade/src/location_shim.ts:600–613  ·  view source on GitHub ↗
(path?: string | number | null)

Source from the content-addressed store, hash-verified

598 path(): string;
599 path(path: string | number | null): this;
600 path(path?: string | number | null): string | this {
601 if (typeof path === 'undefined') {
602 return this.$$path;
603 }
604
605 // null path converts to empty string. Prepend with "/" if needed.
606 path = path !== null ? path.toString() : '';
607 path = path.charAt(0) === '/' ? path : '/' + path;
608
609 this.$$path = path;
610
611 this.composeUrls();
612 return this;
613 }
614
615 /**
616 * Retrieves a map of the search parameters of the current URL, or changes a search

Callers 2

urlMethod · 0.95
upgrade.spec.tsFile · 0.45

Calls 3

composeUrlsMethod · 0.95
charAtMethod · 0.80
toStringMethod · 0.65

Tested by

no test coverage detected