MCPcopy
hub / github.com/angular-ui/ui-router / urlResolve

Function urlResolve

test/angular/1.3/angular.js:16514–16539  ·  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

16512 *
16513 */
16514function urlResolve(url) {
16515 var href = url;
16516
16517 if (msie) {
16518 // Normalize before parse. Refer Implementation Notes on why this is
16519 // done in two steps on IE.
16520 urlParsingNode.setAttribute("href", href);
16521 href = urlParsingNode.href;
16522 }
16523
16524 urlParsingNode.setAttribute('href', href);
16525
16526 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
16527 return {
16528 href: urlParsingNode.href,
16529 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
16530 host: urlParsingNode.host,
16531 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
16532 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
16533 hostname: urlParsingNode.hostname,
16534 port: urlParsingNode.port,
16535 pathname: (urlParsingNode.pathname.charAt(0) === '/')
16536 ? urlParsingNode.pathname
16537 : '/' + urlParsingNode.pathname
16538 };
16539}
16540
16541/**
16542 * 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