ember.js: how to abort transitions if target matches current path -
is there general way (i.e. in application-router) abort transitions if target (including dynamic ids) matches current route?
i tried hooking willtransition transition.params found seem contain current ids , have nothing compare them to.
the params attribute of transition reference current route's params, not target. need @ models provided transition via providedmodels attribute. code should this:
willtransition: function(transition) { if ((this.get('routename') === transition.targetname) && (this.get('currentmodel') === transition.providedmodels[transition.targetname])) { transition.abort(); return; } // ... other code here ... }
Comments
Post a Comment