vendredi 4 novembre 2016

Passing associated models to actions in EmberJS

I have a hard time understanding the logic behind the way EmberJS deals with passing associated models as action arguments.

In a template I have the following:


  <p></p>

  
    <p >
      
    </p>
  


The weird thing is that in the doStuff action

  • person is a Model
  • relationship is a Model
  • otherPerson is a Promise

I don't know if it's an expected behavior and how to deal the right way with it if so.

Note: This is a contrived example and passing all those arguments is weird, it's just to illustrate my point.

Note2: I'm aware I could use Promise.resolve(otherPerson) in my action but I don't see why I should use a low-level call like this.

Thanks!




Aucun commentaire:

Enregistrer un commentaire