Search code examples
javascriptember.jsember-datarelationship

EmberJS - Computed on async relationships


How can I use computed to monitor async loaded relationships?

In the following example, I would expect the parent title to be displayed as soon as it's loaded into the store.

https://emberjs.jsbin.com/yakofaxazu/1/edit?html,js,console,output


Solution

  • No need for computed props.

    Just use below in template :

    <li>Item: {{item.title}}, Parent: {{item.parent.title}}</li>
    

    And also the parent relationship should be async: true