V
V
Valery Serov2016-02-14 16:41:15
backbone.js
Valery Serov, 2016-02-14 16:41:15

Why does the destroy only work on exactly half of the models in the collection?

_.each(todos.models, function(num) {
      		num.destroy()
      	})

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Dudin, 2016-03-09
@outbreak

The .destroy() method is missing callbacks in the options hash:

num.destroy({
    success: function(model, response) {...},
    error: function(err) {...}
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question