vendredi 8 mai 2015

Error while processing route: index Cannot read property 'fixturesForType' of undefined TypeError: Cannot read property 'fixturesForType' of undefined

I have just started with ember.js.While working with fixtures and displaying the data on my page I am getting undefined Typeerror.

My code looks like Category.js

App.Category = DS.Model.extend({

title:DS.attr('string')

});

App.Category.reopenClass({

FIXTURES: [

{id: 1, title: "Produce"},

{id: 2, title: "Baking"},

{id: 3, title: "Household"},

{id: 4, title: "New category"}

] });

Model.js

App.ApplicationAdapter = DS.FixtureAdapter;

App.IndexRoute = Ember.Route.extend({

model:function(){

return this.store.find('category');

} });

All
  • {{#each}} {{title}}
  • {{/each}}

Can someone tell me why I am getting this error and how to fix it.




Aucun commentaire:

Enregistrer un commentaire