single-add-remove.ejs
456 Bytes
// remove the association with task1
project.setTasks([task2]).on('success', function(associatedTasks) {
// you will get task2 only
})
// remove 'em all
projects.setTasks([]).on('success', function(associatedTasks) {
// you will get an empty array
})
// or remove 'em more directly
projects.removeTask(task1).on('success', function() {
// it's gone
})
// and add 'em again
projects.addTask(task1).on('success', function() {
// it's back again
})