01 Mar How to allow only numbers with or without decimal values in Angular.js
The code is pretty simple: [javascript] angular .module('MyApp') .directive('numbersOnly', numbersOnly) [/javascript] [javascript] function numbersOnly(){ return { require: 'ngModel', link: function(scope, element, attrs, modelCtrl) { modelCtrl.$parsers.push(function (inputValue) { if (inputValue...