I'm working in a Wakanda environnement with the angular-wakanda connector.
Assume this model : Employee(firstName,lastName,company) and Company(name)
In the employee form, I have a select input that is filled with companies names (which is a entity collection).
I have set a ng-model="selectedCompany"
in the select
When I select one company and perform a save, the value I get represent the value I have pass in the value of my option (ID or name).
When I assign the value to a new entity using the $create()
method, I don't know which way to set the entity to the relation attribute. I assume that I have to give an entity. The thing is that I already have the entitycollection with all the entities. So I don't see the reason why should I query again the server just to assign somthing that I have already.
So the thing is that we should have a method like $find
or $getById
that will not do a request on the server but get the entity that is already loaded in the entityCollection. For now I use my own method that do a simple loop over my array. (I can share the code if anybody need it)
Am I missing a way to do that?