0
Have a list of products, but my list does not have the quantity field, and nor should have because it would be stock control and that is not it.
I want the quantity field so when you click (+) add 1 and click (-) decrease 1.
I try to create the quantity field in the controller this way:
$scope.user.bebidasextras.quantidade=0;
And in View this way:
<i class='icon ion-plus-round icon-plus-round' mouse-down-up ng-click='addProduct(product)'></i>
<span class='product-quantity'>{{bebida.quantidade}}</span>
<i class='icon ion-minus-round icon-minus-round' mouse-down-up ng-click='removeProduct(product)'></i>
But even the zero value (0) does not appear in my view so that the user understands that the item is reset.
How to create this field, which will be saved later?
I need to see more of the code to be able to help. In Scope you always have 1 product alone or is it an array? In the view that part of the code is inside an ng-repeat?
– André Vicente
In your Scope you put
$scope.user.bebidasextras.quantidade
and in your view you should put{{user.bebidasextras.quantidade}}
.– Marco Garcia