In the code below, AngularJS ng-options
renders the value but records the position in the array and not the value.
I get the following json:
[{"iduniforme":1,
"nomeuniforme":"Uniforme 5 itens",
"itensuniforme":[{...},{...},{...},{...},{...}]},
{"iduniforme":2,
"nomeuniforme":"Uniforme 7 itens",
"itensuniforme":{...},{...},{...},{...},{...},{...},{...}]}]
Using Angularjs ng-options, I mount my select:
<div class="form-group">
<label>Uniforme da Equipe</label>
<select class="form-control" name="uniforme" id="uniforme"
ng-model="uniforme" ng-options="x.nomeuniforme for x in listaUniformes">
<option value="">Selecione o uniforme</option>
</select>
</div>
I can render normally, ie the options appear correctly, however, ah but when I submit the form the amount recorded is the position within the array [0] or [1] and not the value in "nomeuniforme" in this case would be "Uniform 5 items" or "Uniform 7 items".
How do I resolve this? I need to register the value "Uniform 5 items" or "Uniform 7 items" in the base.