I want to reload my model in my controller,and I read the document from here
so I defined the action:reload in my controller and route both,such as:
reload:function(){
this.get('model').reload();
}
when I triggered the action use this.send('reload')
,it comes out the error this.get(...).reload is not a function
,so did I misunderstand the document?
Check that your model is not a collection. You can only reload a record. If your model is a collection you should do the following:
reload:function(){
this.get('model').forEach(function(record){
record.reload();
});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With