MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / parseAppUrl

Function parseAppUrl

code/songhop/www/lib/angular/angular.js:10481–10496  ·  view source on GitHub ↗
(relativeUrl, locationObj)

Source from the content-addressed store, hash-verified

10479
10480
10481function parseAppUrl(relativeUrl, locationObj) {
10482 var prefixed = (relativeUrl.charAt(0) !== '/');
10483 if (prefixed) {
10484 relativeUrl = '/' + relativeUrl;
10485 }
10486 var match = urlResolve(relativeUrl);
10487 locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?
10488 match.pathname.substring(1) : match.pathname);
10489 locationObj.$$search = parseKeyValue(match.search);
10490 locationObj.$$hash = decodeURIComponent(match.hash);
10491
10492 // make sure path starts with '/';
10493 if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') {
10494 locationObj.$$path = '/' + locationObj.$$path;
10495 }
10496}
10497
10498
10499/**

Callers 2

LocationHtml5UrlFunction · 0.70
LocationHashbangUrlFunction · 0.70

Calls 2

urlResolveFunction · 0.70
parseKeyValueFunction · 0.70

Tested by

no test coverage detected