The idea is that the user should not be able to enter a decimal point while he tries to type in a number into the number-input-box. I thought of capturing the $event on the controller and then change the data on the input control. But this didn't work for me. I have this input box in the angular app web page:
<input type="number" ng-keydown="checkfordecimal($event, age)" min="1" max="125" name="inputage" ng-required="true" ng-model="model.age" />
controller:
$scope.checkfordecimal = function($event, age)
{
if($event.which === 110 || $event.which === 190)
{
//do something
}
}
Can you think of a better way to achieve this?