As pointed out by @Steve, I used the custom my-decimals , which matches the view with the model when input losses lose focus.
<input type="number" my-decimals ng-model="vm.orderid"/> angular.directive('myDecimals', function() { return { require: 'ngModel', link: function(scope, elm, attrs, ctrl) { elm.blur(function() { var val = ctrl.$viewValue; ctrl.$setViewValue(val * 1); ctrl.$render(); }); } } });
source share