ng-model is not updating in Angularjs -
acutally learning angularjs. i've introduced problem when click ng-click, ng-model not updating. code follows,
<div ng-repeat="product in cart"> <input type="number" ng-model="product.quantity" ng-required class="input-sm"> <button class="btn btn-xs" type="button" ng-click="product.quantity++">+</button> <button class="btn btn-xs" type="button" ng-click="product.quantity--">-</button> </div>
try this
<button type="button" ng-click="product.quantity = product.quantity+1">+</button> <button type="button" ng-click="product.quantity = product.quantity -1">-</button>
Comments
Post a Comment