How to use ampersand-rest-collection - 10 common examples

To help you get started, we’ve selected a few ampersand-rest-collection examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AmpersandJS / ampersand-view / test / renderCollection.js View on Github external
fireDanger: 'string'
    },
    session: {
        active: 'boolean'
    },
    derived: {
        classes: {
            deps: ['something', 'fireDanger', 'active'],
            fn: function () {
                return this.something + this.active;
            }
        }
    }
});

var Collection = AmpersandCollection.extend({
    model: Model
});

var ItemView = AmpersandView.extend({
    template: '<li><a href=""></a><span></span><input></li>',
    initialize: function () {
        // register a misc handler so we can test release
        this.listenTo(this.model, 'change:something', function () {});
    },
    render: function () {
        this.renderWithTemplate();
        this.el.id = '_' + this.model.id;
        return this;
    }
});
github sinfo / eventdeck / client / js / models / membersCurrentParticipation.js View on Github external
/* global app */
var AmpCollection = require('ampersand-rest-collection')
var SingleRequest = require('ampersand-collection-single-request-mixin')
var PaginationMixin = require('ampersand-pagination-mixin')
var Member = require('./member')

module.exports = AmpCollection.extend({
  model: Member,
  url: '/api/members',
  data: {
    sort: 'id',
    limit: 30
  },
  initialize: function () {
    this.url += '?event=' + app.me.selectedEvent
  }
}, SingleRequest, PaginationMixin)
github StochSS / stochss / app / static / modelEditor / app.js View on Github external
console.log("Running JS " + performance.now())

//var Router = require('./router');
//var ConvertModelView = require('./convertToSpatial/model');
var _ = require('underscore');
var AmpersandCollection = require('ampersand-rest-collection');
var Model = require('./models/model');
var Mesh = require('./models/mesh');
var util = require('./forms/util');

console.log("Requesting models " + performance.now())

ModelCollection = AmpersandCollection.extend( {
    url: "/models",
    comparator: util.alphaNumByName,
    model: Model,

    ajaxConfig: function () {
        return {
            xhrFields: {
                timeout : 120000
            }
        };
    }
});

PublicModelCollection = AmpersandCollection.extend( {
    url: "/publicModels",
    comparator: util.alphaNumByName,
github tableflip / guvnor / lib / web / client / models / logs.js View on Github external
var Collection = require('ampersand-rest-collection')
var Log = require('./log')

module.exports = Collection.extend({
  url: function () {
    return `${this.parent.collection.parent.url}/processes/${this.parent.name}/logs`
  },
  ajaxConfig: {
    xhrFields: {
      withCredentials: true
    }
  },
  model: Log
})
github StochSS / stochss / stochss / client / src / models / model-versions.js View on Github external
var Collection = require('ampersand-rest-collection');
var ModelVersion = require('./model-version');

module.exports = Collection.extend({
  model: ModelVersion
});
github StochSS / stochss / client / models / models.js View on Github external
var app = require('ampersand-app');
var RestCollection = require('ampersand-rest-collection');
var Model = require('./model');
var path = require('path');

module.exports = RestCollection.extend({
  model: Model,
  url: function () { 
    return path.join(
      app.getApiPath(),
      'models',
      String(app.me.name)
    ) 
  }
});
github AmpersandJS / ampersand / template / shared / client / models / persons.js View on Github external
var Collection = require('ampersand-rest-collection');
var Person = require('./person');


module.exports = Collection.extend({
    model: Person,
    url: '/api/people'
});
github sinfo / eventdeck / client / js / models / tags.js View on Github external
var AmpCollection = require('ampersand-rest-collection')
var tagModel = require('./tag')

module.exports = AmpCollection.extend({
  model: tagModel,
  url: '/api/tags'
})
github StochSS / stochss / app / static / modelEditor / publicLibrary.js View on Github external
var Model = require('./models/model');
var Mesh = require('./models/mesh');
var AmpersandCollection = require('ampersand-rest-collection');
var util = require('./forms/util');

ModelCollection = AmpersandCollection.extend( {
    url: "/models",
    comparator: util.alphaNumByName,
    model: Model,

    ajaxConfig: function () {
        return {
            xhrFields: {
                timeout : 120000
            }
        };
    }
});

PublicModelCollection = AmpersandCollection.extend( {
    url: "/publicModels",
    comparator: util.alphaNumByName,
github StochSS / stochss / app / static / modelEditor / publicLibrary.js View on Github external
PublicModelCollection = AmpersandCollection.extend( {
    url: "/publicModels",
    comparator: util.alphaNumByName,
    model: Model,

    ajaxConfig: function () {
        return {
            xhrFields: {
                timeout : 120000
            }
        };
    }
});

MeshCollection = AmpersandCollection.extend( {
    url: "/meshes",
    comparator: util.alphaNumByName,
    model: Mesh,

    ajaxConfig: function () {
        return {
            xhrFields: {
                timeout : 120000
            }
        };
    }
});

var publicModelCollection = new PublicModelCollection();
var modelCollection = new ModelCollection();
var meshCollection = new MeshCollection();

ampersand-rest-collection

ampersand-collection with REST and Lodash mixins.

MIT
Latest version published 8 years ago

Package Health Score

42 / 100
Full package analysis

Popular ampersand-rest-collection functions