model.hasChanged

hasChangedmodel.hasChanged([attribute])
Has the model changed since its last set? If an attribute is passed, returns true if that specific attribute has changed.

Note that this method, and the following change-related ones, are only useful during the course of a "change" event.

book.on("change", function() {
  if (book.hasChanged("title")) {
    ...
  }
});
doc_Backbone
2016-04-17 12:21:38
Comments
Leave a Comment

Please login to continue.