Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Backbone Models In Collection Is Added Here

     reset: function(models, options) {
        console.log("this plays at creation");

        options = options ? _.clone(options) : {};
        for (var i = 0; i < this.models.length; i++) {
          this._removeReference(this.models[i], options);
        }
        options.previousModels = this.models;
        this._reset();
        
        models = this.add(models, _.extend({silent: true}, options));
        if (!options.silent) this.trigger('reset', this, options);
        return models;
      },
Source by # #
 
PREVIOUS NEXT
Tagged: #Backbone #Models #In #Collection #Is #Added #Here
ADD COMMENT
Topic
Name
6+3 =