angular-input-digits

An attribute to restrict an element to a certain number of numeric digits.

Download .zip Download .tar.gz View on GitHub

Notice you can only enter 3 numeric characters into the field below.

$scope.something: {{ something }}

Try it:

<input type="text" digits="3" ng-model="something" />

Check out the source for this page for more details. All we used was this for the main.js file:

'use strict';
var app = angular.module('app', [ 'input-digits' ]);

app.controller('MainCtrl', function () {
  // nothing needed here!
});