examples/npm/output.js
function(model, options) {
      var coll = this;
      options || (options = {});
      model = this._prepareModel(model, options);
      if (!model) return false;
      var success = options.success;
      options.success = function(nextModel, resp, xhr) {
        coll.add(nextModel, options);
        if (success) success(nextModel, resp, xhr);
      };
      model.save(null, options);
      return model;
    }
function(model, options) {
      var coll = this;
      options || (options = {});
      model = this._prepareModel(model, options);
      if (!model) return false;
      var success = options.success;
      options.success = function(nextModel, resp, xhr) {
        coll.add(nextModel, options);
        if (success) success(nextModel, resp, xhr);
      };
      model.save(null, options);
      return model;
    }
function ( model , options ) { var coll = this ; options || ( options = { } ) ; model = this . _prepareModel ( model , options ) ; if ( ! model ) return false ; var success = options . success ; options . success = function ( nextModel , resp , xhr ) { coll . add ( nextModel , options ) ; if ( success ) success ( nextModel , resp , xhr ) ; } ; model . save ( null , options ) ; return model ; }
Create a new instance of a model in this collection. After the model has been created on the server, it will be added to the collection. Returns the model, or 'false' if validation on a new model fails.
Create a new instance of a model in this collection . After the model has been created on the server it will be added to the collection . Returns the model or false if validation on a new model fails .