From 7c2428218893f59c6a4499667488009ca67f3385 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 1 Jun 2012 11:31:10 -0700 Subject: chore($route): rename events BREAKING CHANGE rename $beforeRouteChange to $routeChangeStart rename $afterRouteChange to $routeChangeSuccess --- src/ng/directive/ngView.js | 2 +- src/ng/route.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ng/directive/ngView.js b/src/ng/directive/ngView.js index 4924ed1a..1d2a5d29 100644 --- a/src/ng/directive/ngView.js +++ b/src/ng/directive/ngView.js @@ -115,7 +115,7 @@ var ngViewDirective = ['$http', '$templateCache', '$route', '$anchorScroll', '$c var lastScope, onloadExp = attr.onload || ''; - scope.$on('$afterRouteChange', update); + scope.$on('$routeChangeSuccess', update); update(); diff --git a/src/ng/route.js b/src/ng/route.js index 5386e12a..ab198188 100644 --- a/src/ng/route.js +++ b/src/ng/route.js @@ -230,7 +230,7 @@ function $RouteProvider(){ /** * @ngdoc event - * @name angular.module.ng.$route#$beforeRouteChange + * @name angular.module.ng.$route#$routeChangeStart * @eventOf angular.module.ng.$route * @eventType broadcast on root scope * @description @@ -238,7 +238,7 @@ function $RouteProvider(){ * resolving all of the dependencies needed for the route change to occurs. * Typically this involves fetching the view template as well as any dependencies * defined in `resolve` route property. Once all of the dependencies are resolved - * `$afterRouteChange` is fired. + * `$routeChangeSuccess` is fired. * * @param {Route} next Future route information. * @param {Route} current Current route information. @@ -246,7 +246,7 @@ function $RouteProvider(){ /** * @ngdoc event - * @name angular.module.ng.$route#$afterRouteChange + * @name angular.module.ng.$route#$routeChangeSuccess * @eventOf angular.module.ng.$route * @eventType broadcast on root scope * @description @@ -347,7 +347,7 @@ function $RouteProvider(){ $rootScope.$broadcast('$routeUpdate', last); } else if (next || last) { forceReload = false; - $rootScope.$broadcast('$beforeRouteChange', next, last); + $rootScope.$broadcast('$routeChangeStart', next, last); $route.current = next; if (next) { if (next.redirectTo) { @@ -393,7 +393,7 @@ function $RouteProvider(){ next.locals = locals; copy(next.params, $routeParams); } - $rootScope.$broadcast('$afterRouteChange', next, last); + $rootScope.$broadcast('$routeChangeSuccess', next, last); } }, function(error) { if (next == $route.current) { -- cgit v1.2.3