Skip to content

Commit d3d0f56

Browse files
committed
feat(client:auth): implement auth components as a seperate module
1 parent 9133296 commit d3d0f56

File tree

5 files changed

+12
-3
lines changed

5 files changed

+12
-3
lines changed

app/generator.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,10 @@ export default class Generator extends Base {
380380
if(this.filters.socketio) angModules.push("'btford.socket-io'");
381381
if(this.filters.uirouter) angModules.push("'ui.router'");
382382
if(this.filters.uibootstrap) angModules.push("'ui.bootstrap'");
383-
if(this.filters.auth) angModules.push("'validation.match'");
383+
if(this.filters.auth) {
384+
angModules.unshift(`'${this.scriptAppName}.auth'`);
385+
angModules.push("'validation.match'");
386+
}
384387

385388
this.angularModules = '\n ' + angModules.join(',\n ') +'\n';
386389
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict';
2+
3+
angular.module('<%= scriptAppName %>.auth', [
4+
'ngCookies'
5+
]);

app/templates/client/components/auth(auth)/auth.service(js).js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
return Auth;
173173
}
174174

175-
angular.module('<%= scriptAppName %>')
175+
angular.module('<%= scriptAppName %>.auth')
176176
.factory('Auth', AuthService);
177177

178178
})();

app/templates/client/components/auth(auth)/user.service(js).js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
angular.module('<%= scriptAppName %>')
3+
angular.module('<%= scriptAppName %>.auth')
44
.factory('User', function ($resource) {
55
return $resource('/api/users/:id/:controller', {
66
id: '@_id'

test/test-file-creation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ describe('angular-fullstack generator', function () {
267267
'client/app/admin/admin.' + stylesheet,
268268
'client/app/admin/admin.' + script,
269269
'client/app/admin/admin.controller.' + script,
270+
'client/components/auth/auth.module.' + script,
270271
'client/components/auth/auth.service.' + script,
271272
'client/components/auth/user.service.' + script,
272273
'client/components/mongoose-error/mongoose-error.directive.' + script,

0 commit comments

Comments
 (0)