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

Function parseAppUrl

test/angular/1.2/angular.js:9285–9300  ·  view source on GitHub ↗
(relativeUrl, locationObj, appBase)

Source from the content-addressed store, hash-verified

9283
9284
9285function parseAppUrl(relativeUrl, locationObj, appBase) {
9286 var prefixed = (relativeUrl.charAt(0) !== '/');
9287 if (prefixed) {
9288 relativeUrl = '/' + relativeUrl;
9289 }
9290 var match = urlResolve(relativeUrl, appBase);
9291 locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?
9292 match.pathname.substring(1) : match.pathname);
9293 locationObj.$$search = parseKeyValue(match.search);
9294 locationObj.$$hash = decodeURIComponent(match.hash);
9295
9296 // make sure path starts with '/';
9297 if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') {
9298 locationObj.$$path = '/' + locationObj.$$path;
9299 }
9300}
9301
9302
9303/**

Callers 2

LocationHtml5UrlFunction · 0.70
LocationHashbangUrlFunction · 0.70

Calls 2

urlResolveFunction · 0.70
parseKeyValueFunction · 0.70

Tested by

no test coverage detected