Skip to content

Instantly share code, notes, and snippets.

@newtonsbm
Created April 10, 2013 17:00
Show Gist options
  • Save newtonsbm/5356457 to your computer and use it in GitHub Desktop.
Save newtonsbm/5356457 to your computer and use it in GitHub Desktop.
CodeSchool - BackBone.js - Level 6 - Challenge 6
//A (Correct)
var AppointmentList = Backbone.Collection.extend({
model: Appointment,
initialize: function(){
this.on('remove',this.hideModel);
},
hideModel: function(model){
model.trigger('hide');
}
});
//B (Incorrect):
var AppointmentList = Backbone.Collection.extend({
model: Appointment,
initialize: function(){
this.on('remove',this.model.trigger('hide'));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment