Reputation: 1531
I have a problem displaying model data inside the template. Here's my code:
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return this.store.find('video');
}
});
import DS from 'ember-data';
export default DS.JSONAPIAdapter.extend({
defaultSerializer: 'JSONSerializer'
});
import DS from 'ember-data';
export default DS.JSONSerializer.extend({});
{{#each video in model}}
<p>{{video.title}}</p>
{{/each}}
however the data is not shown. I have checked the response from the server and it's a valid jsonapi.org format response. I tested by returning an Ember.Object
from /router/index.js:model()
and the data renders just fine. I'm confused why ember can't access the data from the store when I have specified to use JSONSerializer
but renders when data returns as an array of objects. Any ideas?
UPDATE
If I log {{log model}}
in template, I get the following output:
Class {store: Class, isLoaded: true, manager: Class, isUpdating: false, __ember1448322947671: null…}
Upvotes: 1
Views: 868
Reputation: 1531
I have figured it out. Looks like Ember changed the serializer name, it should be JSONAPISerializer
instead of JSONSerializer
Upvotes: 1