A simple Angular 1 directive to draw a n digit pin input.
Add module pinCode to your app module dependencies.
Add an element of type pin.
<pin digits="4" pin="pin"></pin>
Name | Description | Mandatory | Default Value |
---|---|---|---|
pin | scope varible where the pin value will be binded | Yes | NA |
digits | number of digits | No | 4 |
hide-input | hide input value after inserted | No | true |
hide-timeout | time after which the input value will be hidden | No | 200 (ms) |
hide-symbol | symbol used to show when the input is hidden (HTML Symbol Entities) | No | ⚫ (⚫) |
on-enter | function called when user press enter after the last digit insertion | No | NA |
To focus in an input, broadcast the event 'focusPin' with the object {digitIndex:x}
$scope.$broadcast('focusPin',{digitIndex:0});