@davegoulash wrote:
Hi,
I have a component that gets passed the model Point
As per DDAU I want to add to an array of shots, which is a property of Point. I therefore need to obtain or pass in the point to the registerShot action in the route:
actions: { registerShot(point, shot) { point.get('shots').addObject(shot); } }
inside my component:
<button class="btn" {{action (route-action "registerShot" point "FH")}}>Forehand</button>
This doesn't work and is perhaps conceptually unsound?
How would I go about this? Is there a way to get the model that is loaded by the route inside that route's action?
Posts: 2
Participants: 1