nytimes / backbone.trackit

Manage unsaved changes in a Backbone Model.
202 stars 33 forks source link

add options to ignore properties #21

Open theoephraim opened 9 years ago

theoephraim commented 9 years ago

Allows you to set an array of properties to exclude from tracking.

This is useful if you can't always add trackit_silent when setting things.

I'm using this to tell trackit to ignore changes on computed fields. You could also use this to tell trackit to ignore changes on nested models.

Usage:

...
initialize: function() {
  this.startTracking({ignore: ['dontTrackMe', 'nestedModel', 'computedProperty']});
}