-1
I am redoing a project now in angular, and to get an array of the form I used getlist and Prod[] and Qtd[] inside the tag form, now in angular use ngmodel and not the form itself, how can I take this data and send in the back in array form, by ngModel?
<div>
<div class="row justify-content-around col-md-12">
<select class="form-control col-md-5 produtos" name="prod[]">
<option value="1">TST-01 - </option>
<option value="2">TST-02 - </option>
<option value="3">TST-02 - Teste-02</option>
</select>
<div class="col-md-7">
<button class="btn btn-danger btn-sm" type="button"><i class="fas fa-trash-alt"></i></button>
</div>
</div>
<input class="form-control col-md-2 mt-1 quantidade" min="0" max="999" type="number" name="qtd[]" placeholder=" Qtd">
<br>
</div>
ngModel
produto = { produto_desc: '', codigo: "", tipo: "", valoruni: "", valoruniDol: "", quantidade: 0, qtdvalorTot: 0, Compvalortot: '', CompvalortotDol: '', prod: [], qtd: [] };
You want to take the selected data within the option?
– Pedro Henrique Cndido Ferreira
Or do you want to send from back and pick on select? using ngModel?
– Pedro Henrique Cndido Ferreira
These inputs that I put are dynamic, when the guy clicka on the button appears another select for him to select another product and quantity, wanted to join this in an array or two one of products and another of quantities and send to the back, using ngModel
– Eduardo Fellipe