I have been trying to set minimum value 1 for a input text box "number". And i have a button to decrement it (using angularjs). Even though i have set min="1" on clicking the button its goes below 1. How can i maintain the minimum value 1? Below is the code
https://jsfiddle.net/3uyoLqhg/2/
<body ng-app="">
<input ng-model="quan" ng-init="quan=5" min="1" type="number"/>
<button ng-click="quan=quan-1">minus</button>