-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
72 lines (68 loc) · 2.48 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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>TODO List</title>
<link rel="stylesheet" href="semantic/css/semantic.min.css"/>
<style>
body {
font-family: '微软雅黑';
}
i.remove {
cursor: pointer;
}
</style>
<script src="angular/angular.min.js"></script>
<script>
var module = angular.module("TODOList",[]);
var todoController = module.controller("todoController",[function() {
var _self = this;
_self.todo = "";
_self.todoList = [];
_self.submit = function() {
!!_self.todo && _self.todoList.push(_self.todo);
_self.todo = "";
};
_self.deleteToDo = function($index) {
_self.todoList.splice($index,1)
};
}]);
</script>
</head>
<body ng-app="TODOList">
<div class="ui four column grid">
<div class="column two">
</div>
<div class="column eight wide" ng-controller="todoController as ctrl">
<div class="ui segment">
<div class="ui large header" contenteditable="true">待办记录</div>
<div class="ui blue inverted segment">
请在下面的输入框中输入待办项:
</div>
<div class="ui form">
<div class="field">
<form action="" ng-submit="ctrl.submit()">
<div class="ui left icon input">
<input ng-model="ctrl.todo" placeholder="Something to do..." type="text">
<i class="bookmark icon"></i>
</div>
</form>
</div>
</div>
<div class="ui small header" ng-hide="ctrl.todoList.length == 0">当前有{{ctrl.todoList.length}}项</div>
<div class="ui list">
<div class="item" ng-repeat="todo in ctrl.todoList track by $index">
<i class="mail outline icon"></i>
<div class="content">
<a class="header">{{todo}}</a>
<i class="remove icon" ng-click="ctrl.deleteToDo($index)"></i>
</div>
</div>
</div>
</div>
</div>
<div class="column">
</div>
</div>
</body>
</html>