Answers for "backbone js"

1

backbone js

var ships = new Backbone.Collection;

ships.on("add", function(ship) {
  alert("Ahoy " + ship.get("name") + "!");
});

ships.add([
  {name: "kjnFlying Dutchman"},
  {name: "Black Pearl"}
]);
Posted by: Guest on March-21-2021
0

backbone js event listener

var ViewName = Backbone.View.extend({  
   initialize: function(){  
      this.$el.on("eventName", this.functionName, this)  
   },  
   functionName: function(){  
    //whatever  
   },
   remove: function() {
      this.$el.off("eventName", this.functionName);
      Backbone.View.prototype.remove.apply(this, arguments);
   }  
});
Posted by: Guest on May-29-2020
0

backbone js event listener

var ViewName = Backbone.View.extend({  
   initialize: function(){  
      this.$el.on("eventName", this.functionName, this)  
   },  
   functionName: function(){  
    //whatever  
   }  
});
Posted by: Guest on May-29-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language