MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / urlResolve

Function urlResolve

lib/test/angular/1.6.7/angular.js:20646–20672  ·  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

20644 *
20645 */
20646function urlResolve(url) {
20647 var href = url;
20648
20649 // Support: IE 9-11 only
20650 if (msie) {
20651 // Normalize before parse. Refer Implementation Notes on why this is
20652 // done in two steps on IE.
20653 urlParsingNode.setAttribute('href', href);
20654 href = urlParsingNode.href;
20655 }
20656
20657 urlParsingNode.setAttribute('href', href);
20658
20659 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
20660 return {
20661 href: urlParsingNode.href,
20662 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
20663 host: urlParsingNode.host,
20664 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
20665 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
20666 hostname: urlParsingNode.hostname,
20667 port: urlParsingNode.port,
20668 pathname: (urlParsingNode.pathname.charAt(0) === '/')
20669 ? urlParsingNode.pathname
20670 : '/' + urlParsingNode.pathname
20671 };
20672}
20673
20674/**
20675 * 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