简体   繁体   English

Ember.js具有许多使用固定装置显示的关系数据

[英]Ember.js hasMany relationship data display using fixtures

I am trying to display data from hasMany relationship using fixtures. 我试图显示使用夹具从hasMany关系的数据。 My code is available here: http://jsbin.com/xijewu/8/edit 我的代码在这里: http : //jsbin.com/xijewu/8/edit

<script type="text/x-handlebars" id="item">
  <h2>{{ title }}</h2>
  <p>{{ description }}</p>

    {{#each comment in model.comments}}
      {{ comment.content }}
    {{/each}}

</script>

But it seems to be not displaying the data. 但是它似乎没有显示数据。 Any idea ? 任何想法 ?

I found a related discussion here: http://discuss.emberjs.com/t/what-is-an-async-relationship-async-true-vs-async-false/4107/6 I added the aync: true option and it's working now! 我在这里找到了相关的讨论: http ://discuss.emberjs.com/t/what-is-an-async-relationship-async-true-vs-async-false/4107/6我添加了aync:true选项,并且现在正在工作!

comments: DS.hasMany('comment', {
  async: true
})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM