AngularJS directive to allow only specific numbers in input

I came across this question on stackoverflow to allow the user to type only specific numbers such as 3,6,9,12 and so on. You can use the following directive which checks for the key and allows as input. Directive Code angular.module(‘demo’).directive(‘restrictTo’, function() { return { restrict: ‘A’, link: function (scope, element, attrs) { var include = /3|6|9|12/;… Read More AngularJS directive to allow only specific numbers in input