Angular directive for a customized numeric user inputs
bower install --save angular-step-input
angular-step-input.js
.tien.stepInput
to you app modules.tien-step-input
directive.$scope.demo = {{demo}}
$scope.demo = {{demo}}
$scope.demo = {{demo}}
$scope.demo = {{demo}}
$scope.demo = {{demo}}
$scope.available = {{available}}
Use the tien-step-input
directive as element or attribute. Add the
ng-model
directive to bind an integer. Optionally pass through a custom options object
width the step-input-options
attribute.
<tien-step-input ng-model="foo" step-input-options="my_options"></tien-input-step>
<script>
$scope.options = {
min_value: -1,
overrides: [
{value: -1, style: 'danger', view_value: '<i class="fa fa-times"></i>'},
{value: 0, style: 'warning', view_value: '<i class="fa fa-question"></i>'}
]
};
</script>
Type: String
Default: fa fa-minus
CSS classes to add to the icon on the decrease button. By default FontAwesome icons are used.
Type: String
Default: fa fa-plus
CSS classes to add to the icon on the increase button. By default FontAwesome icons are used.
Type: Integer
Default: 0
Minimum value of the field, negative integers allowed.
Type: Integer
Default: 999
Maximum value of the field, negative integers allowed.
Type: String
Default: primary
CSS classes applied to the container element of the directive. The default stylesheet provides all
Bootstrap color classes (primary
, success
, info
,
warning
, danger
). The [sass-src file]()
includes a mixin to easily add custom colors.
Type: Function
| Expression
| Boolean
Default: false
By default (false
) the input displays the current integer-value in a regular input
element. With the view_value
option it is possible to alter this representation with
a function (demo 4) or angular expression (demo 5) that returns an HTML-string.
Type: Array
Default: []
This Array overrides options based on specific input values. Each array element has to be an Object with at least the value-property. All options mentioned above are available. See demo 3 & 6.
angular-step-input 0.1.0 · Created by 10KB
Thanks to FontAwesome for providing awesome icons.