aboutsummaryrefslogtreecommitdiffstats
path: root/src/widgets.js
diff options
context:
space:
mode:
authorMisko Hevery2011-08-23 22:30:14 -0700
committerIgor Minar2011-08-31 14:31:23 -0700
commitad3cc16eef0a13844e6e05abcb18c46a370f0814 (patch)
tree48c90bd555d26eef0164b7deeff5417e300a6536 /src/widgets.js
parent08d09ecbaa07564bf3cf6a62e0be4c41b355d23b (diff)
downloadangular.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.js5
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;