aboutsummaryrefslogtreecommitdiffstats
path: root/src/service/route.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/service/route.js')
-rw-r--r--src/service/route.js18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/service/route.js b/src/service/route.js
index b7f8bd02..8d8086af 100644
--- a/src/service/route.js
+++ b/src/service/route.js
@@ -237,22 +237,16 @@ function $RouteProvider(){
function updateRoute() {
var next = parseRoute(),
- last = $route.current,
- Controller;
+ last = $route.current;
if (next && last && next.$route === last.$route
&& equals(next.pathParams, last.pathParams) && !next.reloadOnSearch && !forceReload) {
- next.scope = last.scope;
- $route.current = next;
- copy(next.params, $routeParams);
- last.scope && last.scope.$emit('$routeUpdate');
- } else {
+ last.params = next.params;
+ copy(last.params, $routeParams);
+ $rootScope.$broadcast('$routeUpdate', last);
+ } else if (next || last) {
forceReload = false;
$rootScope.$broadcast('$beforeRouteChange', next, last);
- if (last && last.scope) {
- last.scope.$destroy();
- last.scope = null;
- }
$route.current = next;
if (next) {
if (next.redirectTo) {
@@ -308,7 +302,5 @@ function $RouteProvider(){
});
return result.join('');
}
-
-
}];
}