-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrollers.js
More file actions
170 lines (137 loc) · 4.81 KB
/
controllers.js
File metadata and controls
170 lines (137 loc) · 4.81 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
angular.module('starter.controllers', [])
.controller('DashCtrl', function($scope) {
console.info('DashCtrl');
/* $scope.$on('$ionicView.loaded', function() {
console.log(' DashCtrl loaded', $scope, $scope.$id)
});
$scope.$on('$ionicView.beforeEnter', function() {
// Anything you can think of
console.log(' DashCtrl BeforeEnter', $scope, $scope.$id)
});
$scope.$on('$ionicView.enter', function() {
// Anything you can think of
console.log(' DashCtrl enter', $scope, $scope.$id)
});
$scope.$on('$ionicView.afterEnter', function() {
console.log(' DashCtrl afterEnter', $scope, $scope.$id)
});
$scope.$on('$ionicView.beforeLeave', function() {
console.log(' DashCtrl beforeLeave', $scope, $scope.$id)
// Anything you can think of
});
$scope.$on('$ionicView.leave', function() {
console.log(' DashCtrl Leave', $scope, $scope.$id)
});
$scope.$on('$ionicView.afterLeave', function() {
console.log(' DashCtrl afterLeave', $scope, $scope.$id)
});
$scope.$on('$ionicView.unloaded', function() {
console.log(' DashCtrl unloaded', $scope, $scope.$id)
// Anything you can think of
});*/
})
.controller('ExtraCtrl', function($scope, $ionicNavBarDelegate, $ionicHistory) {
$ionicNavBarDelegate.showBackButton(true);
$scope.back = function() {
debugger;
$ionicHistory.goBack();
}
})
.controller('ChatsCtrl', function($scope, Chats) {
console.info('ChatsCtrl');
/*$scope.$on('$ionicView.loaded', function() {
console.log(' ChatsCtrl loaded', $scope, $scope.$id)
});
$scope.$on('$ionicView.beforeEnter', function() {
// Anything you can think of
console.log(' ChatsCtrl BeforeEnter', $scope, $scope.$id)
});
$scope.$on('$ionicView.enter', function() {
console.log(' ChatsCtrl enter', $scope, $scope.$id)
// Anything you can think of
});
$scope.$on('$ionicView.afterEnter', function() {
console.log(' ChatsCtrl afterEnter', $scope, $scope.$id)
});
$scope.$on('$ionicView.beforeLeave', function() {
console.log(' ChatsCtrl beforeLeave', $scope, $scope.$id)
// Anything you can think of
});
$scope.$on('$ionicView.leave', function() {
console.log(' ChatsCtrl Leave', $scope, $scope.$id)
});
$scope.$on('$ionicView.afterLeave', function() {
console.log(' ChatsCtrl afterLeave', $scope, $scope.$id)
});
$scope.$on('$ionicView.unloaded', function() {
console.log(' DashCtrl unloaded', $scope, $scope.$id)
// Anything you can think of
});
*/
$scope.chats = Chats.all();
$scope.remove = function(chat) {
Chats.remove(chat);
};
})
.controller('ChatDetailCtrl', function($scope, $stateParams, Chats) {
var _str = 'ChatDetailCtrl'
$scope.chat = Chats.get($stateParams.chatId);
/* $scope.$on('$ionicView.loaded', function() {
console.log(_str + ' loaded', $scope, $scope.$id)
});
$scope.$on('$ionicView.beforeEnter', function() {
// Anything you can think of
console.log(_str + ' BeforeEnter', $scope, $scope.$id)
});
$scope.$on('$ionicView.enter', function() {
console.log(_str + ' enter', $scope, $scope.$id)
// Anything you can think of
});
$scope.$on('$ionicView.afterEnter', function() {
console.log(_str + ' afterEnter', $scope, $scope.$id)
});
$scope.$on('$ionicView.beforeLeave', function() {
console.log(_str + ' beforeLeave', $scope, $scope.$id)
// Anything you can think of
});
$scope.$on('$ionicView.leave', function() {
console.log(_str + ' Leave', $scope, $scope.$id)
});
$scope.$on('$ionicView.afterLeave', function() {
console.log(_str + ' afterLeave', $scope, $scope.$id)
});
$scope.$on('$ionicView.unloaded', function() {
console.log(_str + 'unloaded', $scope, $scope.$id)
// Anything you can think of
});*/
})
.controller('AccountCtrl', function() {
var vm = this;
vm.settings = {
enableFriends: true
};
var _41 = 41;
vm.setName = setName;
vm.add41 = add41;
activate()
function setName() {
vm.name = 'pepito';
}
function activate() {
var arrayn = [];
for (var i = 0; i < 40; i++) {
var obj = {
name: i,
}
arrayn.push(obj)
}
vm.numbers = arrayn;
}
function add41() {
var obj = {
name: _41,
}
_41++;
vm.numbers.unshift(obj)
}
});