-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
43 lines (36 loc) · 825 Bytes
/
main.js
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
//Initialisation
var ngTodo = angular.module('ngTodo', [])
//controller, head of department
ngTodo.controller('mainController', function($scope){
$scope.todolists = [
{
title: 'Do My Homework',
details : 'I must do my homework today'
},
{
title: 'Do my Assignment',
details: 'I must do my assignment tomorrow'
},
{
title: 'Have Breakfast',
details: 'I must have my breakfast at 9'
},
{
title: 'Have Lunch',
details: 'I must have my lunch at 2'
},
{
title: 'Have Dinner',
details: 'I must have my dinner at 10'
}
];
$scope.addTodolist = function(title) {
$scope.todolists.push(title);
};
$scope.addTodolist = function(details) {
$scope.todolists.push(details);
};
$scope.deleteTodolist = function(index) {
$scope.todolists.splice(index, 1);
}
});