diff options
Diffstat (limited to 'src/ng/route.js')
| -rw-r--r-- | src/ng/route.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ng/route.js b/src/ng/route.js index 032e3716..ec05d1f8 100644 --- a/src/ng/route.js +++ b/src/ng/route.js @@ -286,7 +286,6 @@ function $RouteProvider(){ */ var matcher = switchRouteMatcher, - dirty = 0, forceReload = false, $route = { routes: routes, @@ -304,12 +303,12 @@ function $RouteProvider(){ * creates new scope, reinstantiates the controller. */ reload: function() { - dirty++; forceReload = true; + $rootScope.$evalAsync(updateRoute); } }; - $rootScope.$watch(function() { return dirty + $location.url(); }, updateRoute); + $rootScope.$on('$locationChangeSuccess', updateRoute); return $route; |
