MCPcopy Index your code
hub / github.com/angular/angular / prepareExternalUrl

Method prepareExternalUrl

packages/common/src/location/location.ts:148–153  ·  view source on GitHub ↗

* Normalizes an external URL path. * If the given URL doesn't begin with a leading slash (`'/'`), adds one * before normalizing. Adds a hash if `HashLocationStrategy` is * in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use. * * @param url String representing a URL.

(url: string)

Source from the content-addressed store, hash-verified

146 * @returns A normalized platform-specific URL.
147 */
148 prepareExternalUrl(url: string): string {
149 if (url && url[0] !== '/') {
150 url = '/' + url;
151 }
152 return this._locationStrategy.prepareExternalUrl(url);
153 }
154
155 // TODO: rename this method to pushState
156 /**

Callers 10

goMethod · 0.95
replaceStateMethod · 0.95
replaceStateMethod · 0.45
goMethod · 0.45
computeHrefMethod · 0.45
navigateMethod · 0.45
cancelMethod · 0.45
handleNavigateMethod · 0.45

Implementers 1

SpyLocationpackages/common/testing/src/location_m

Calls

no outgoing calls

Tested by

no test coverage detected