diff options
| author | Misko Hevery | 2011-08-23 22:30:14 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-08-31 14:31:23 -0700 |
| commit | ad3cc16eef0a13844e6e05abcb18c46a370f0814 (patch) | |
| tree | 48c90bd555d26eef0164b7deeff5417e300a6536 /src/widgets.js | |
| parent | 08d09ecbaa07564bf3cf6a62e0be4c41b355d23b (diff) | |
| download | angular.js-ad3cc16eef0a13844e6e05abcb18c46a370f0814.tar.bz2 | |
feat($route): add events before/after route change
BREAKING CHANGE
* removing `onChange`
FEATURE
* adding three events: $beforeRouteChange, $afterRouteChange, $routeReload
Diffstat (limited to 'src/widgets.js')
| -rw-r--r-- | src/widgets.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/widgets.js b/src/widgets.js index a1c4c5d6..42e608dd 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -1422,10 +1422,9 @@ angularWidget('ng:view', function(element) { var template; var changeCounter = 0; - $route.onChange(function(){ + this.$on('$afterRouteChange', function(){ changeCounter++; - })(); //initialize the state forcefully, it's possible that we missed the initial - //$route#onChange already + }); this.$watch(function(){return changeCounter;}, function() { var template = $route.current && $route.current.template; |
