ng-code-input

Angualrjs code input directive

Usage no npm install needed!

<script type="module">
  import ngCodeInput from 'https://cdn.skypack.dev/ng-code-input';
</script>

README

ng-code-input

UI component for handling code retrival with seperate input elements

gif

Installing

npm i ng-code-input

Include the ng-code-input modules in your application

var app = angular.module('myapp', ['ng-code-input']);

Basic example

The most basic use of the directive in html

<ng-code 
    ng-model="ctrl.code" 
    digits="3" 
    class="my-custom-class">
</ng-code>

With a related angular controller:

angular.module('myapp')
.controller('ctrl', ['$scope', function ($scope){
    $scope.code = null;
}]);

Options

Attribute Description Default value Required
digits number of digits to display 3 optional
class custom class default optional

MIT Licence

MIT Licence