In my Ember Application Handlebars template, I need some model data to display. In Index or other routes, these types of code work but in application route they are not working. Application Route:
App.ApplicationRoute = Ember.Route.extend({
model: function()
{
return this.store.findAll('archive');
}
});
Application template:
<script type="text/x-handlebars" data-template-name="application">
{{#each}}
{{title}}
{{/each}}
</script>
DS.Model:
App.ApplicationAdapter = DS.FixtureAdapter;
App.Archive = DS.Model.extend({
title: DS.attr('string'),
day: DS.attr('number')
});
App.Archive.FIXTURES = [
{
"id":1,
"title": "First title",
"day": 06
},
{
"id":2,
"title": "Second title",
"day": 08
}
];
I couldn't find out where is the prob. In Ember, can I use model for Application template?