PageRenderTime 41ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/recipe-app/js/models/recipe-list-model.js

https://github.com/ifandelse/devlink2012-Introduction-to-Backbone.js
JavaScript | 17 lines | 10 code | 1 blank | 6 comment | 0 complexity | 58987f14467f4c3e204d574b1e1822b1 MD5 | raw file
Possible License(s): MIT
  1. /*
  2. Collection model. Note that we've set the url property. We're using the
  3. built in Backbone.sync logic, so items in this collection will pass their
  4. ids as the last segment (e.g. /api/recipe/12). Note how Backbone provides
  5. a *ton* of functionality, while this is minimal code!
  6. */
  7. define( [
  8. 'backbone',
  9. 'jquery',
  10. 'models/recipe-model'
  11. ], function ( Backbone, $, RecipeModel ) {
  12. return Backbone.Collection.extend( {
  13. url: "/api/recipe",
  14. model: RecipeModel
  15. } );
  16. } );