-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
101 lines (88 loc) · 3.52 KB
/
demo.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Angular Light</title>
<link rel="stylesheet" href="bootstrap.min.css">
<script src="angular.light.js"></script>
</head>
<body class="container">
<div ng-app="demoApp1">
<div ng-controller="formController" class="row">
<h2>demoApp1 -> formController</h2>
<form class="form-inline" action="/action_page.php">
<div class="form-group">
<label for="text">Email:</label> {{portal.login.user}}
<br>
<input type="text" class="form-control" placeholder="email" ng-model="portal.login.user">
</div>
<div class="form-group">
<label for="text">Email:</label> {{portal.login.password}}
<br>
<input type="text" class="form-control" placeholder="email" ng-model="portal.login.password">
</div>
<div class="form-group">
<label for="email">Email:</label> {{portal.email}}
<br>
<input type="email" class="form-control" placeholder="email" ng-model="portal.email">
</div>
<br>
<br>
<button type="button" class="btn btn-default" id="resetBtn">Reset Email</button>
</form>
</div>
<hr>
<div ng-controller="editController" class="row">
<h2>demoApp1 -> editController</h2>
<div class="form-group">
<input type="number" class="form-control" placeholder="width" ng-model="width">
</div>
<div class="form-group">
<input type="number" class="form-control" placeholder="width" ng-model="height">
</div>
<div style="width:{{width}}px;height:{{height}}px;background:red"></div>
</div>
<hr>
</div>
<div ng-app="demoApp2">
<div ng-controller="rangeController">
<h2>demoApp2 -> rangeController</h2>
<div class="form-group">
<input type="number" class="form-control" placeholder="range" ng-model="range">
</div>
<div class="form-group">
<input type="range" class="form-control" placeholder="range" ng-model="range">
</div>
<progress value="{{range}}" max="100"></progress>
</div>
</div>
<script>
var demoApp1 = angular.module('demoApp1');
demoApp1.controller('formController', formController);
demoApp1.controller('editController', editController);
function formController($scope) {
$scope.portal = {
login: {
user: 'admin',
password: '123456',
id: '123',
},
email: 'myemail@yahoo.com',
}
var resetBtn = document.getElementById('resetBtn');
resetBtn.onclick = function () {
$scope.portal.email = "default@gmail.com";
}
}
function editController($scope) {
$scope.width = 50;
$scope.height = 50;
}
var demoApp2 = angular.module('demoApp2');
demoApp2.controller('rangeController', rangeController);
function rangeController($scope) {
$scope.range = 30;
}
</script>
</body>
</html>