EmberJS - 根据异步关系计算
EmberJS - Computed on async relationships
如何使用计算来监控异步加载关系?
在下面的示例中,我希望 parent 标题在加载到商店后立即显示。
https://emberjs.jsbin.com/yakofaxazu/1/edit?html,js,console,output
不需要计算道具。
只需在模板中使用以下内容即可:
<li>Item: {{item.title}}, Parent: {{item.parent.title}}</li>
而且 parent
关系应该是 async: true
如何使用计算来监控异步加载关系?
在下面的示例中,我希望 parent 标题在加载到商店后立即显示。
https://emberjs.jsbin.com/yakofaxazu/1/edit?html,js,console,output
不需要计算道具。
只需在模板中使用以下内容即可:
<li>Item: {{item.title}}, Parent: {{item.parent.title}}</li>
而且 parent
关系应该是 async: true