MCPcopy Create free account
hub / github.com/bclinkinbeard/angular / parseAppUrl

Function parseAppUrl

test/fixtures/foo.js:9177–9192  ·  view source on GitHub ↗
(relativeUrl, locationObj, appBase)

Source from the content-addressed store, hash-verified

9175
9176
9177function parseAppUrl(relativeUrl, locationObj, appBase) {
9178 var prefixed = (relativeUrl.charAt(0) !== '/');
9179 if (prefixed) {
9180 relativeUrl = '/' + relativeUrl;
9181 }
9182 var match = urlResolve(relativeUrl, appBase);
9183 locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?
9184 match.pathname.substring(1) : match.pathname);
9185 locationObj.$$search = parseKeyValue(match.search);
9186 locationObj.$$hash = decodeURIComponent(match.hash);
9187
9188 // make sure path starts with '/';
9189 if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') {
9190 locationObj.$$path = '/' + locationObj.$$path;
9191 }
9192}
9193
9194
9195/**

Callers 2

LocationHtml5UrlFunction · 0.85
LocationHashbangUrlFunction · 0.85

Calls 2

urlResolveFunction · 0.85
parseKeyValueFunction · 0.85

Tested by

no test coverage detected