次のコードがあります
initialize : function(option){
//some code
this.PassedCollection = this.options.serverResponse.passedCollection;
this.NewCollection = new Collection();
this.NewSectionCollection.bind("add", this.add, this);
this.NewSectionCollection.bind("remove", this.remove, this);
//some code
}
//some other code
addRemove: function(){
this.PassedCollection.forEach(_.bind(function(passedModel){
if(passedModel.reference==event.target.id){
if($('input[name='+passedModel.reference+']').attr( 'checked')){
console.log("checked");
this.NewCollection.add(passedModel);
}
else{
console.log("unchecked");
this.NewCollection.remove(passedModel, {silent : true});
console.log(JSON.stringify(this.NewCollection));
}
}, this));
}
「passedModel」を NewCollection に追加できますが、削除できません。何が間違っているのか、コードを修正するにはどうすればよいですか?