Skip to content

Instantly share code, notes, and snippets.

angular.module('app')
.directive('flOnlyNumber', function() {
return {
restrict: 'EA',
require: 'ngModel',
link: function(scope, element, attrs, ngModel) {
scope.$watch(attrs.ngModel, function(newValue, oldValue) {
if (newValue) {
var spiltArray = String(newValue).split("");