Angular-ui-numeric

AngularJS directive for enhancing a text input for entering numeric values, with up/down buttons and arrow key handling.

View the Project on GitHub choroshin/angular-ui-numeric

AngularJS numeric widget directive.

Uses jQuery Spinner widget.

Installation

add the numeric module to your Angular App.


angular.module('app', ['ui.numeric']);

Usage

Default:


<div numeric="" ng-model="numericValue"></div>

numeric control value: {{numericValue}}


Properties in obejct or as attribute:


<div numeric="{min:1,max:10}" step="2" ng-model="numeric"></div>

numeric control has event listeners attached to it, assigned by defining the listeners in the option passed to the numeric control:

html:

  <div numeric="numeric_options" ng-model="numeric_event"></div>
controller:

 $scope.numeric_options = {
    start: function (event, ui) { console.log('numeric start'); },
    spin: function (event, ui) { console.log('numeric spin'); }
 }
  
{{event}}