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

Function urlResolve

lib/test/angular/1.5.0/angular.js:18844–18869  ·  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

18842 *
18843 */
18844function urlResolve(url) {
18845 var href = url;
18846
18847 if (msie) {
18848 // Normalize before parse. Refer Implementation Notes on why this is
18849 // done in two steps on IE.
18850 urlParsingNode.setAttribute("href", href);
18851 href = urlParsingNode.href;
18852 }
18853
18854 urlParsingNode.setAttribute('href', href);
18855
18856 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
18857 return {
18858 href: urlParsingNode.href,
18859 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
18860 host: urlParsingNode.host,
18861 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
18862 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
18863 hostname: urlParsingNode.hostname,
18864 port: urlParsingNode.port,
18865 pathname: (urlParsingNode.pathname.charAt(0) === '/')
18866 ? urlParsingNode.pathname
18867 : '/' + urlParsingNode.pathname
18868 };
18869}
18870
18871/**
18872 * 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