当新页面出现问题时,我正在尝试在route
中获取数据,但我的model
方法没有得到任何回复。其余所有其他方法称为。这有什么不对?
这是我的代码:
import Ember from 'ember';
export default Ember.Route.extend({
model(params){ //not calling
console.log('got the model', params );
return this.store.peekRecord('card-list', params.id );
},
setupController(controller,model) {//called
console.log("super")
this._super(...arguments);
console.log("model is", controller,"\n", model );
},
init(){//called
console.log("init calledx");
}
});
更新
Router.map(function() {
this.route('review');
this.route('confirmation');
this.route('cs2i', function() {
this.route('balance', function() {
this.route('balanceDetails');
this.route('balanceEdit', { path: '/balanceEdit/:id' });
this.route('balanceReview', { path: '/balanceReview/:id' });
});
this.route('purchase', function() {
this.route('purchaseDetails');
this.route('purchaseEdit');
this.route('purchaseReview');
});
});