forked from LambdaTest/sample-todo-app
-
Notifications
You must be signed in to change notification settings - Fork 23
/
index.html
86 lines (71 loc) · 2.46 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>Sample page - lambdatest.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<style type="text/css">
.well {
font-size: 32px;
}
.done-true {
text-decoration: line-through;
color: grey;
}
input[type=checkbox]
{
/* Double-sized Checkboxes */
-ms-transform: scale(1.5); /* IE */
-moz-transform: scale(1.5); /* FF */
-webkit-transform: scale(1.5); /* Safari and Chrome */
-o-transform: scale(1.5); /* Opera */
padding: 10px;
margin: 15px;
}</style>
<script type="text/javascript">
angular.module('sampleApp', [])
.controller('SampleListController', function() {
var sampleList = this;
sampleList.sampletodos = [
{text:'First Item', done:false, name: 'li1'},
{text:'Second Item', done:false, name: 'li2'},
{text:'Third Item', done:false, name: 'li3'},
{text:'Fourth Item', done:false, name: 'li4'},
{text:'Fifth Item', done:false, name: 'li5'}];
sampleList.addsampletodo = function() {
sampleList.sampletodos.push({text:sampleList.sampletodoText, done:false, name:'li'+(sampleList.sampletodos.length+1)});
sampleList.sampletodoText = '';
};
sampleList.remaining = function() {
var count = 0;
angular.forEach(sampleList.sampletodos, function(sampletodo) {
count += sampletodo.done ? 0 : 1;
});
return count;
};
});
</script>
</head>
<body>
<div ng-app="sampleApp">
<div class="container">
<h2>LambdaTest Sample App</h2>
<div class="well" ng-controller="SampleListController as sampleList">
<span>{{sampleList.remaining()}} of {{sampleList.sampletodos.length}} remaining</span>
<ul class="list-unstyled">
<li ng-repeat="sampletodo in sampleList.sampletodos">
<input type="checkbox" ng-model="sampletodo.done" name="{{sampletodo.name}}">
<span class="done-{{sampletodo.done}}">{{sampletodo.text}}</span>
</li>
</ul>
<form ng-submit="sampleList.addsampletodo()">
<input type="text" id="sampletodotext" ng-model="sampleList.sampletodoText" size="30"
placeholder="Want to add more">
<input class="btn btn-primary" type="submit" id="addbutton" value="add">
</form>
</div>
</div>
</div>
</body>
</html>