-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathexample.html
42 lines (42 loc) · 1.26 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html>
<head>
<title>OTP Input Directive</title>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<style>
body{
font-family: 'Roboto', sans-serif;
}
.otpBox{
width:250px;margin:0 auto;margin-top: 150px;padding: 20px;background: #f5f5f5;border: 1px solid #d4d4d4;height: 150px;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.3/angular.min.js"></script>
<script src="otpInputDirective.min.js"></script>
<script>
'use strict';
var app = angular.module('exampleApp', ["otpInputDirective"]);
app.controller('appCtrl',function($scope) {
$scope.otpInput={
size:6,
type:"text",
onDone: function(value){
console.log(value);
},
onChange: function(value){
console.log(value);
}
}
});
</script>
</head>
<body ng-app="exampleApp" ng-controller="appCtrl">
<div class="otpBox">
<h4 style="text-align: center">Enter One Time Password</h4>
<div otp-input-directive options="otpInput"></div>
<div style="margin-top:20px;text-align: center">
Output: {{otpInput.value}}
</div>
</div>
<body>
</html>