MCPcopy Create free account
hub / github.com/apache/cloudstack / parseRoute

Function parseRoute

tools/ngui/static/js/lib/angular.js:7477–7490  ·  view source on GitHub ↗

* @returns the current active route, by matching it against the URL

()

Source from the content-addressed store, hash-verified

7475 * @returns the current active route, by matching it against the URL
7476 */
7477 function parseRoute() {
7478 // Match a route
7479 var params, match;
7480 forEach(routes, function(route, path) {
7481 if (!match && (params = switchRouteMatcher($location.path(), path))) {
7482 match = inherit(route, {
7483 params: extend({}, $location.search(), params),
7484 pathParams: params});
7485 match.$$route = route;
7486 }
7487 });
7488 // No route matched; fallback to "otherwise" route
7489 return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});
7490 }
7491
7492 /**
7493 * @returns interpolation of the redirect path with the parametrs

Callers 1

updateRouteFunction · 0.85

Calls 6

forEachFunction · 0.85
switchRouteMatcherFunction · 0.85
inheritFunction · 0.85
extendFunction · 0.85
searchMethod · 0.65
pathMethod · 0.45

Tested by

no test coverage detected