Created
December 11, 2012 21:33
-
-
Save EdwardIII/4262313 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
var Person = Backbone.Model.extend(); | |
var Baskets = Backbone.Collection.extend({ | |
'url': '/api/v1/basket/' | |
}); | |
var baskets = new Baskets; | |
baskets.fetch(); | |
var basket = baskets.at(0); | |
console.dir(baskets); | |
console.dir(basket); | |
}); | |
/* Server is returning: | |
{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 1}, "objects": [{"id": "1", "people": ["/api/v1/person/10/"], "resource_uri": "/api/v1/basket/1/"}]} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment