Answer the question
In order to leave comments, you need to log in
How to pick up only id from select using angular?
I'm creating a form, I ran into a problem that for the select tag I have an id and a name, I show the name to the user and, depending on his choice, I have to write in json id, but I get the whole array from the name and id. How can I make it record only id?
<div class="form-group">
<label>Пример: </label>
<select ng-model="user.example"
ng-options="example.name for example in examples"
class="form-control"
ng-value="example.code"
required></select>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question