Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
view = Marionette.ItemView.extend({
initialize: function() {
this.listenTo(this.model, 'change:detail', this.calculateTotal);
this.listenTo(this.model, 'change:total', this.render);
},
calculateTotal: function() {
var newTotal = calc();
this.model.set('total', newTotal);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment