当模型是时,我如何在路由钩子中对模型进行get('transaction').rollback()
or ?我不知道如何从钩子中访问模型。deleteRecord()
deactivate
isNew
应用程序.js
App.Router.map(function() {
this.resource('users', function() {
this.route('new');
})
});
App.UsersNewRoute = Ember.Route.extend({
model: function() {
return App.User.createRecord();
},
activate: function() {
this.controllerFor('users').set('newUserCreate', true);
},
deactivate: function() {
this.controllerFor('users').set('newUserCreate', false);
}
});