()
| 7400 | } |
| 7401 | |
| 7402 | function updateRoute() { |
| 7403 | var next = parseRoute(), |
| 7404 | last = $route.current; |
| 7405 | |
| 7406 | if (next && last && next.$$route === last.$$route |
| 7407 | && equals(next.pathParams, last.pathParams) && !next.reloadOnSearch && !forceReload) { |
| 7408 | last.params = next.params; |
| 7409 | copy(last.params, $routeParams); |
| 7410 | $rootScope.$broadcast('$routeUpdate', last); |
| 7411 | } else if (next || last) { |
| 7412 | forceReload = false; |
| 7413 | $rootScope.$broadcast('$routeChangeStart', next, last); |
| 7414 | $route.current = next; |
| 7415 | if (next) { |
| 7416 | if (next.redirectTo) { |
| 7417 | if (isString(next.redirectTo)) { |
| 7418 | $location.path(interpolate(next.redirectTo, next.params)).search(next.params) |
| 7419 | .replace(); |
| 7420 | } else { |
| 7421 | $location.url(next.redirectTo(next.pathParams, $location.path(), $location.search())) |
| 7422 | .replace(); |
| 7423 | } |
| 7424 | } |
| 7425 | } |
| 7426 | |
| 7427 | $q.when(next). |
| 7428 | then(function() { |
| 7429 | if (next) { |
| 7430 | var keys = [], |
| 7431 | values = [], |
| 7432 | template; |
| 7433 | |
| 7434 | forEach(next.resolve || {}, function(value, key) { |
| 7435 | keys.push(key); |
| 7436 | values.push(isString(value) ? $injector.get(value) : $injector.invoke(value)); |
| 7437 | }); |
| 7438 | if (isDefined(template = next.template)) { |
| 7439 | } else if (isDefined(template = next.templateUrl)) { |
| 7440 | template = $http.get(template, {cache: $templateCache}). |
| 7441 | then(function(response) { return response.data; }); |
| 7442 | } |
| 7443 | if (isDefined(template)) { |
| 7444 | keys.push('$template'); |
| 7445 | values.push(template); |
| 7446 | } |
| 7447 | return $q.all(values).then(function(values) { |
| 7448 | var locals = {}; |
| 7449 | forEach(values, function(value, index) { |
| 7450 | locals[keys[index]] = value; |
| 7451 | }); |
| 7452 | return locals; |
| 7453 | }); |
| 7454 | } |
| 7455 | }). |
| 7456 | // after route change |
| 7457 | then(function(locals) { |
| 7458 | if (next == $route.current) { |
| 7459 | if (next) { |
nothing calls this directly
no test coverage detected