I am working on an Ember app in which some data is being posted to four different views. The code below works for 3 views that have single word names(Local, Business, Entertainment), but on my WorldNews view the data isn't loading.
In Chrome Ember Inspector, the WorldNews model is being called as world-news, so I'm not quite sure what I need to change in order to have the data be posted properly.
Data Info
App.WorldNews = DS.Model.extend({
title: DS.attr('string'),
post: DS.attr('string'),
date: DS.attr('date')
});
App.WorldNews.FIXTURES = [
{
id: '1',
title: 'Lorem ipsum dolor sit amet, consectetu',
post: 'asdf.',
date: new Date('1-7-2041')
}
]
Index / World News Template
<script type="text/x-handlebars" data-template-name="worldnews">
<h2>World News</h2>
{{#each entries in model}}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title" id="panel-title">{{entries.title}} - {{entries.date}}<a class="anchorjs-link" href="#panel-title"><span class="anchorjs-icon"></span></a></h3>
</div>
<div class="panel-body">
{{entries.post}}
</div>
</div>
{{/each}}
</script>
Aucun commentaire:
Enregistrer un commentaire