Ember.js 无法显示包含的数据
我正在使用Ember.js 无法显示包含的数据,ember.js,ember-data,Ember.js,Ember Data,我正在使用Ember数据和JSONAPIAdapter在我的路由上以jsonapi格式获取数据-这工作正常 // ok /posts/1 this.store.findRecord('posts', params.post_id); 我现在正试图使用ds finder include加载包含的数据,数据正在被提取,但没有反映在.hbs 哈佛商学院: 您的注释和代码相互矛盾。您在注释中说数据正在获取,但没有反映在模板中 但是,在代码中,似乎没有失败的部分正在获取第二次调用的数据:this
Ember数据
和JSONAPIAdapter
在我的路由
上以jsonapi
格式获取数据-这工作正常
// ok
/posts/1
this.store.findRecord('posts', params.post_id);
我现在正试图使用ds finder include
加载包含的数据,数据正在被提取,但没有反映在.hbs
哈佛商学院:
您的注释和代码相互矛盾。您在注释中说数据正在获取,但没有反映在模板中 但是,在代码中,似乎没有失败的部分正在获取第二次调用的数据:
this.store.findRecord('posts',params.post_id,{include:'comments')代码>
对后端的/posts/1/注释的正常GET请求是否成功返回数据
// not working
/posts/1/comments
this.store.findRecord('posts', params.post_id, { include: 'comments' });
{{#each post.comments as |comment index|}}
comment: {{comment}}
{{/each}}