* @returns the current active route, by matching it against the URL
()
| 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 |
no test coverage detected