mercredi 2 novembre 2016

Ember error handling

My model looks like,

App.Post=DS.model.extend({
    id :some_id,
    comments:DS.belongsTo('comments',{async:true});
})
App.CommentsRoute=Ember.Route.extend({
    model:function(){
        var post = this.store.find('post',1);
        return post.get('comments');
    }
});

There is error in post.get('comments').

when I again fetch the route , as expected the request(post.get('comments')) is not sent to server, its loaded from store .

I want to load comments from server when there is error in the previous fetch. What I can do?




Aucun commentaire:

Enregistrer un commentaire