-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2015-11-27frello.html
38 lines (36 loc) · 1.4 KB
/
2015-11-27frello.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
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script>
angular.module('app', []);
angular.module('app')
.controller('FrelloController', function($scope){
$scope.remove = function(i){
$scope.tasks.splice(i, 1);
}
});
</script>
</head>
<body ng-app="app">
<div ng-controller="FrelloController" class="container well" ng-init="tasks = []">
<h1>Frello</h1>
<input type="text" ng-minlength="3" required ng-model="task" class="form-control" /><br>
<button class="btn btn-primary" ng-click="tasks.push(task)">Add task</button><br><br>
<div
ng-repeat="task in tasks track by $index"
ng-class="{ 'bg-info': !taskdone[$index],
'bg-success': taskdone[$index] }"
style="padding:15px; margin-bottom:20px;"
>
<p>
<label style="margin: 0 10px -3px 0;"><input style=" background:#ffffff;" type="checkbox" ng-model="taskdone[$index]" class="close" /></label>
{{ task }}
<button type="button" class="close" aria-label="Close" ng-click="remove($index)"><span aria-hidden="true">×</span></button>
</p>
</div>
</div>
</body>
</html>