Add objects to an array property of the model from a component. DDAU


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) {

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?

OK I solved it:

  actions: {
    registerShot(shot) {

<button class="btn" {{action (route-action "registerShot" "FH")}}>Forehand</button>