I use the following select statement:
<select ng-model="vm.institution" ng-options="c as c.institutionName for c in vm.institutionsOfUser"></select>
In my model, the institution is stored but what I will have is to onyl store the id of the institution selected (and contained in vm.institutionsOfUser-> id)
Is there a possibility to do this?
You just need to change ngOptions a little c.id as c.institutionName for c in vm.institutionsOfUser:
<select ng-model="vm.institution"
ng-options="c.id as c.institutionName for c in vm.institutionsOfUser"></select>
This will bind model to institution id instead of entire object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With