javascript - Backbone Collection fetching throwing id error -
i'm trying figure out backbone.js , going through peepecode backbone.js basics video.
when try , fetch collection in chrome's javascript console, throws following error:
uncaught typeerror: cannot use 'in' operator search 'id' in [{
here json:
[{ "id" : "1", "title": "bound - zen bound ingame music", "artist": "ghost monkey" }, { "id": "2", "title": "where earth meets sky", "artist": "tom heasley" }]
here collection code:
window.albums = backbone.collection.extend({ model : album, url: '/services/albumsservice' });
any ideas? not sure why happening. have id field in json..so i'm puzzled. help!
your model album visible collection? , inherits backbone.model.extend?
Comments
Post a Comment