javascript - Last element in Backbone collection add / reset? -
How do you know that a model in the batch is final?
/ / inside scene collection = new ObjectCollection (); This.listenTo (collection, 'add', added); Added: function (mod) {//} (mod.position.last)} collection.add ([{'name': 'human'}, {'name': 'cat'}]);
added: function (mod) {If (this.collection.at (this.collection.length-1) == mod) {// do stuff}}
Comments
Post a Comment