2015-07-10 angular►filter Angular only number filter By: Ryan Wong at Jul 10 2015 12:48 pm Here’s an angular filter that allows only numbers. 123456789101112131415161718192021function onlynum() { return { require: 'ngModel', restrict: 'A', link: function (scope, element, attr, ctrl) { function inputValue(val) { if (val) { var digits = val.replace(/[^0-9]/g, ''); if (digits !== val) { ctrl.$setViewValue(digits); ctrl.$render(); } return parseInt(digits,10); } return undefined; } ctrl.$parsers.push(inputValue); } }} Newer Angular stripe example Older phonegap sqlite tutorial in ionic 1