-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.ctrl.js
64 lines (64 loc) · 1.41 KB
/
main.ctrl.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
angular.module('app').controller("MainController", function(){
var vm = this;
vm.title = 'Ejemplo con Angular JS';
vm.searchInput = '';
vm.shows = [
{
title: 'Avatar',
year: 2009,
favorite: false
},
{
title: 'Forrest Gump',
year: 1994,
favorite: true
},
{
title: 'Batman, El caballero oscuro',
year: 2008,
favorite: false
},
{
title: 'Inception',
year: 2010,
favorite: true
},
{
title: 'El silencio de los inocentes',
year: 1991,
favorite: true
}
];
vm.orders = [
{
id: 1,
title: 'Por año, ascendente',
key: 'year',
reverse: false
},
{
id: 2,
title: 'Por año, descendiente',
key: 'year',
reverse: true
},
{
id: 3,
title: 'Por título, ascendete',
key: 'title',
reverse: false
},
{
id: 4,
title: 'Por título descendente',
key: 'title',
reverse: true
}
];
vm.order = vm.orders[0];
vm.new = {};
vm.addShow = function() {
vm.shows.push(vm.new);
vm.new = {};
};
});