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

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -