<input id="myid" type="number" ng-model="maxVal" ng-change="maxValCheck()"
max="5" min="1" value="1"/>
in the controller
$scope.maxVal;
$scope.maxValCheck = function() {
if($scope.maxVal> 5) {
$scope.maxVal= 5;
}
}
I want to change the value of input field to 5 when it is more than 5.But it does not work. What am I doing wrong? And is there a better way you suggest to do this?