replaceWith (name, models) Transitionpublic
Transition into another route while replacing the current URL, if possible. This will replace the current history entry instead of adding a new one. Beside that, it is identical to transitionTo in all other respects. See 'transitionTo' for additional information regarding multiple models.
Example
App.Router.map(function() {
this.route('index');
this.route('secret');
});
App.SecretRoute = Ember.Route.extend({
afterModel: function() {
if (!authorized()){
this.replaceWith('index');
}
}
});
Parameters:
-
name
String - the name of the route or a URL
-
models
...Object - the model(s) or identifier(s) to be used while transitioning to the route.
Returns:
-
Transition - the transition object associated with this attempted transition
Please login to continue.