Sorry about my English.
I have a select that is populated by a ng-repeat that fills with available products.
The option to select is precisely the amount that you want to buy. The problem is to associate the number with the product because it is only possible to have a ng-model.
How to proceed?
If I’m understanding you correctly, I’m not entirely sure what the issue is. Since you are using an ng-repeat, the select box’s should be associated to that specific product. I made a plunker and just moved the options into the controller.
but you have associated the amount with the product:
ng-model=“product.qtd” --> in this case product is the single product --> so you are storing the value directly on the product.
You repeat loops over all products and the product of the current loop-run is product so everytime you change the quantity you are changing it for the single product. Keep in mind every “product” in the template is only a reference to this “products[$index]”!
So if you are changing the amount of a products the model is in reality this: “products[$index].qtd”