-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
42 lines (30 loc) · 674 Bytes
/
Copy pathapp.js
File metadata and controls
42 lines (30 loc) · 674 Bytes
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
angular.module('myApp', [])
.controller('mainCtrl', function(){
var self = this;
self.listOne = [
'1.1', '1.2', '1.3'
]
self.listTwo = [
'2.2', '2.3', '2.3'
]
self.changeTaskColor = function() {
}
self.addToList = function(item) {
self.listOne.push(this.item);
// console.log(this.item);
}
self.addToOtherList = function(itemTwo) {
self.listTwo.push(this.itemTwo);
// console.log(this.itemTwo);
}
self.todo = [];
self.addToTodo = function(task) {
if(this.task != "") {
self.todo.push(this.task);
}
self.task = "";
}
self.deleteTask = function(index) {
self.todo.splice(index, 1);
}
})