MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / urlResolve

Function urlResolve

code/songhop/www/lib/angular/angular.js:16281–16306  ·  view source on GitHub ↗

* * Implementation Notes for non-IE browsers * ---------------------------------------- * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM, * results both in the normalizing and parsing of the URL. Normalizing means that a relative * URL will be resolved

(url)

Source from the content-addressed store, hash-verified

16279 *
16280 */
16281function urlResolve(url) {
16282 var href = url;
16283
16284 if (msie) {
16285 // Normalize before parse. Refer Implementation Notes on why this is
16286 // done in two steps on IE.
16287 urlParsingNode.setAttribute("href", href);
16288 href = urlParsingNode.href;
16289 }
16290
16291 urlParsingNode.setAttribute('href', href);
16292
16293 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
16294 return {
16295 href: urlParsingNode.href,
16296 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
16297 host: urlParsingNode.host,
16298 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
16299 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
16300 hostname: urlParsingNode.hostname,
16301 port: urlParsingNode.port,
16302 pathname: (urlParsingNode.pathname.charAt(0) === '/')
16303 ? urlParsingNode.pathname
16304 : '/' + urlParsingNode.pathname
16305 };
16306}
16307
16308/**
16309 * Parse a request URL and determine whether this is a same-origin request as the application document.

Callers 8

createHttpBackendFunction · 0.70
parseAbsoluteUrlFunction · 0.70
parseAppUrlFunction · 0.70
$LocationProviderFunction · 0.70
$$SanitizeUriProviderFunction · 0.70
angular.jsFile · 0.70
urlIsSameOriginFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected