I'm new to Backbone. Can you give me a hint what am I missing here?
here is my model:
var Item = Backbone.Model.extend({
url: 'json/item.json',
parse: function(response){
return response.item;
},
});
var item = new Item();
item.fetch();
in console "item.toJSON();" shows the result as expected - id, title etc. But when item is passed through view to template
...
this.$el.append( template( item.toJSON() ) );
...
it can't pick any of the attributes - e.g. item.title -> undefined.
json file looks like this:
{
"item":{
"title": "something something",
.....
}
}