After extensive exploration and experimentation, it seems that returning a value from an ajax request in Emberjs is quite challenging. (I could be mistaken.) The issue appears to be related to the asynchronous nature of callbacks.
Here lies my predicament;
I have a parent model A with children of model B. My goal is to showcase both the parent and children together, along with additional information obtained through an api call leveraging data from model B. I do not intend to store this extra information on model B, but rather wish to display it. Essentially, the setup resembles this:
{{#each modelb in modela.modelbs}}
...
{{/each}}
It would be ideal to achieve something like this:
{{#each modelb in modela.modelbs}}
{{get-info modelb}}
{{/each}}
Where the retrieved information from the api call is rendered.
I attempted using a helper as mentioned earlier. I also experimented with controller logic, however, isolating individual child models to create a computed property proved to be problematic. Additionally, I am uncertain if a computed property would address my needs, considering it requires a return statement. This loops me back to the original issue with helpers. Moreover, creating a computed property directly on the child relationship seems unattainable. While I have the necessary extra information from the api call, linking it with my child model B poses a challenge.
It appears that my approach to this problem may not align with the 'ember way'. Hopefully, there exists a more effective method to tackle this.
Any assistance on this matter would be sincerely appreciated.