/public/js/app/collections/GenericCollection.js

https://github.com/Reflen/spinel · JavaScript · 23 lines · 11 code · 8 blank · 4 comment · 0 complexity · abe4a141e54c98c6c0435ce4ce348f3b MD5 · raw file

  1. // GenericCollection.js
  2. // -------------
  3. define(["jquery", "backbone", "./BaseCollection", "models/GenericItemModel"],
  4. function($, Backbone, BaseCollection, GenericItemModel) {
  5. // Creates a new Backbone Collection class object
  6. var Collection = BaseCollection.extend({
  7. url: function() {
  8. return this.apiUrl + '/' + this.query;
  9. },
  10. model: GenericItemModel
  11. });
  12. // Returns the Model class
  13. return Collection;
  14. }
  15. );