-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrollers.js
More file actions
42 lines (27 loc) · 802 Bytes
/
controllers.js
File metadata and controls
42 lines (27 loc) · 802 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("AppModule").controller("HomeController", function() {
var self = this;
});
angular.module("AppModule").controller("NameController", function(MyNameService) {
var nameData = this;
nameData.setName = function(name) {
MyNameService.setData(name);
}
nameData.getName = function() {
return MyNameService.getData();
}
});
angular.module("AppModule").controller("CountController", function() {
var self = this;
self.count = 0;
self.addOne = function() {
self.count++;
}
});
angular.module("AppModule").controller("ListCtrl", function() {
var self = this;
self.cars = [
{make:"Toyota", model:"Camry"},
{make:"Honda", model:"CR-V"},
{make:"Subaru", model:"Impreza"}
];
});