Skip to content

Commit 650a529

Browse files
committed
style(app): flatten IIFEs
1 parent dafd65a commit 650a529

File tree

5 files changed

+284
-284
lines changed

5 files changed

+284
-284
lines changed

Diff for: app/templates/client/app/main/main.controller(js).js

+28-28
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@
22

33
(function() {
44

5-
function MainController($scope, $http<% if (filters.socketio) { %>, socket<% } %>) {
6-
var self = this;
7-
this.awesomeThings = [];
8-
9-
$http.get('/api/things').then(function(response) {
10-
self.awesomeThings = response.data;<% if (filters.socketio) { %>
11-
socket.syncUpdates('thing', self.awesomeThings);<% } %>
12-
});<% if (filters.models) { %>
13-
14-
this.addThing = function() {
15-
if (self.newThing === '') {
16-
return;
17-
}
18-
$http.post('/api/things', { name: self.newThing });
19-
self.newThing = '';
20-
};
21-
22-
this.deleteThing = function(thing) {
23-
$http.delete('/api/things/' + thing._id);
24-
};<% } if (filters.socketio) { %>
25-
26-
$scope.$on('$destroy', function() {
27-
socket.unsyncUpdates('thing');
28-
});<% } %>
29-
}
30-
31-
angular.module('<%= scriptAppName %>')
32-
.controller('MainController', MainController);
5+
function MainController($scope, $http<% if (filters.socketio) { %>, socket<% } %>) {
6+
var self = this;
7+
this.awesomeThings = [];
8+
9+
$http.get('/api/things').then(function(response) {
10+
self.awesomeThings = response.data;<% if (filters.socketio) { %>
11+
socket.syncUpdates('thing', self.awesomeThings);<% } %>
12+
});<% if (filters.models) { %>
13+
14+
this.addThing = function() {
15+
if (self.newThing === '') {
16+
return;
17+
}
18+
$http.post('/api/things', { name: self.newThing });
19+
self.newThing = '';
20+
};
21+
22+
this.deleteThing = function(thing) {
23+
$http.delete('/api/things/' + thing._id);
24+
};<% } if (filters.socketio) { %>
25+
26+
$scope.$on('$destroy', function() {
27+
socket.unsyncUpdates('thing');
28+
});<% } %>
29+
}
30+
31+
angular.module('<%= scriptAppName %>')
32+
.controller('MainController', MainController);
3333

3434
})();

0 commit comments

Comments
 (0)