原址:http://discuss.emberjs.com/t/get-current-url-in-emberjs/3019

1
2
3
4
5
6
7
afterModel: function (model){
_this = this;

Ember.run.next(function(){
console.log _this.get('router.url')
});
}
1
2
3
afterModel: function(model, transition) {
console.log(Ember.get(transition, 'targetName'));
}