Reputation: 281
I am just getting started with ember... I managed to save the data to firebase but can't get it to the client, this is my code:
Route:
export default Ember.Route.extend({
model() {
return this.get('store').findAll('post')
}
});
template:
{{#each model}}
<h2> {{model.title}}</h2>
{{/each}}
modeljs:
import DS from 'ember-data';
export default DS.Model.extend({
title: DS.attr('string'),
});
I did manage to save an item to firebase with a form on my website so the model is sending data to firebase but I am not sure how to get it back to the view?
Upvotes: 0
Views: 39
Reputation: 9406
The template is wrong.
This is the correct one :
{{#each model as |item|}}
<h2> {{item.title}}</h2>
{{/each}}
Upvotes: 3