devlink2012-Introduction-to-Backbone.js /recipe-app/js/models/recipe-list-model.js

Language Javascript Lines 17
MD5 Hash 58987f14467f4c3e204d574b1e1822b1
Repository https://github.com/ifandelse/devlink2012-Introduction-to-Backbone.js.git View Raw File
| Open JSFiddle
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
/*
	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
	} );
} );
Back to Top