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

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -