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