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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -