-
Notifications
You must be signed in to change notification settings - Fork 1
/
testReg.html
51 lines (47 loc) · 1.48 KB
/
testReg.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
43
44
45
46
47
48
49
50
51
<html>
<head>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
</head>
<body ng-app='app'>
<div ng-controller = 'LabsCtrl' class='container'>
<p>
<input ng-model="emailReg" type="text" placeholder="Email">
<input ng-model = "pwReg" type="password" placeholder="Password">
<button ng-click='register()'>Register</button><br>
<span id="msg-reg"></span>
</p>
<hr>
<p>
<input ng-model="emailResend" type="text" placeholder="Email">
<button ng-click='resend()'>Resend Verification Email</button><br>
<span ng-bing='msg'>{{msg}}</span>
</p>
</div>
<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js'></script>
<script>
var app=angular.module('app', [])
app.controller('LabsCtrl', function ($scope, $http){
$scope.register = function (){
var email = $scope.emailReg,
password = $scope.pwReg;
$http.post('http://localhost:3000/api/register',{
email: email,
password: password,
type: 'register'}
).success(function(data) {
$scope.msg = data.msg;
});
}
$scope.resend = function (){
var email = $scope.emailResend;
$http.post('http://localhost:3000/api/register',{
email: email,
type: 'resend'}
).success(function(data) {
$scope.msg = data.msg;
});
}
})
</script>
</body>
</html>