$scope.allowNumberOnly = function ($event) {
var a = [];
var k = $event.which;
for (var i = 48; i < 58; i++)
a.push(i);
if (k === 46 || k === 8) {
a.push(k);
}
if (!(a.indexOf(k) >= 1))
$event.preventDefault();
};
var a = [];
var k = $event.which;
for (var i = 48; i < 58; i++)
a.push(i);
if (k === 46 || k === 8) {
a.push(k);
}
if (!(a.indexOf(k) >= 1))
$event.preventDefault();
};
No comments:
Post a Comment