ember.js - Callback for change in URL in Ember v1.0.pre -


i want call function when change in url. in newer versions of ember, can observing currentpath. in version, tried this:

ember.route.reopen({   enter: function(router) {     console.log('change in url , need called once per change in url');   } }); 

since there nested routes, method called mutiple times.

if using ember.hashlocation can this, observing lastseturl property:

window.app = ember.application.create({   ...   urlchanged: function(a,b,c,d) {     var url = this.get('router.location.lastseturl');       if (!ember.none(url)) {         alert(url);       }       }.observes('router.location.lastseturl'),   ... }); 

here example of working http://jsfiddle.net/marciojunior/ba4hj/


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -