New to Ember here. I am trying to figure out how to execute an action and the product of that action be used by the #with
helper. Below is an example of my code:
{{#navigation-container as |navigationContainer|}}
{{#with (action navigationContainer.previousPage model) as |prev|}}
{{link-to (t 'navigation.previous') (concat 'course-run.' prev.modelName) prev activeClass="o25" title=prev.title}}
{{/with}}
{{/navigation-container}}
navigation-container
is a component that exposes a few actions, one of which is previousPage
. previousPage
simply returns a model that I then use to create some links and use with ember-keyboard.
I'm receiving an error that the link-to
can't build a route due to prev
being undefined. The action is executing and returning correctly just above this with
block, so I'm assuming the with
block is the problem.
Thanks for any help!