Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Backbone Add To Collection

        var MyTeam1 = Backbone.Collection.extend({  
           model: MyTeam  
        });  
        var player1 = new MyTeam({  
           player: "Sam",  
           planet: "Venus"  
        });  
      //The 'player1' is a type of collection by passing model object in the collection  
        var myval=new MyTeam1([player1]);  
     var player2 = new MyTeam({player:"Jacob", planet:"Neptune"});
     myval.add([player2]);
 
PREVIOUS NEXT
Tagged: #Backbone #Add #To #Collection
ADD COMMENT
Topic
Name
3+9 =