Question

var BasicModel = Backbone.Model.extends({

   url : function() {
       return "/something";
    }

});

var basicModel = new BasicModel();
basicModel.fetch();

If BasicModel is a collection, then the follwoing is possible

   this.on("add", function (model) {
         console.log(model);
    });

Is there any lisiting event I can bind for Backbone model, which get invoked after fetch happened?

Was it helpful?

Solution

use change event.

in your model.

this.on("change", function);

or in your view

this.model.on("change", function);

OTHER TIPS

basicModel.fetch({success:function(){
      //do whatever you want
}});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top