-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo13.html
65 lines (64 loc) · 2.12 KB
/
demo13.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>demo13</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="css/bootstrap.css" rel="stylesheet">
<script type="text/javascript" src="js/angular.js"></script>
</head>
<body>
<div class="container" ng-controller="LoginController">
<div class="login-title text-center">
<h1><small>登陆</small></h1>
</div>
<div class="form">
<div class="form-group">
<div class="col-xs-12">
<div class="input-group">
<span class="input-group-addon"></span>
<span class="glyphicon glyphicon-user"></span>
<input type="text" ng-model="uname" class="form-control" placeholder="用户名" />
</div>
</div>
</div>
</div><br /><br />
<div class="form">
<div class="form-group">
<div class="col-xs-12">
<div class="input-group">
<span class="input-group-addon"></span>
<span class="glyphicon glyphicon-lock"></span>
<input type="text" ng-model="pword" class="form-control" placeholder="密码" />
</div>
</div>
</div>
</div><br /><br />
<div class="form-group form-actions">
<div class="col-xs-4 clo-xs-offset-4">
<button ng-click="login()" type="submit" class="btn btn-sm btn-info">
<span class="glyphicon glyphicon-logo-in"></span>登录
</button>
<button ng-click="reset" class="btn btn-sm btn-info">
<span class="glyphicon glyphicon-off"></span>重置
</button>
</div>
</div>
</div>
<script type="text/javascript">
function LoginController($scope){
$scope.login = function(){
if($scope.uname == "admin" && $scope.pword == "123456"){
alert("登陆成功!");
}else{
alert("用户名密码错误,请检查!");
}
}
}
var app = angular.module("app",[]);
app.controller('LoginController', LoginController);
</script>
</body>
</html>