Skip to content

Commit fe10a72

Browse files
Broccokieronqtran
authored andcommitted
bug(generate): generate module with two-word names
Fixes angular#2724 Close angular#2756
1 parent 9672aef commit fe10a72

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/angular-cli/blueprints/module/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = {
5858
},
5959

6060
afterInstall: function (options) {
61-
options.entity.name = path.join(this.entityName, this.dasherizedModuleName);
61+
options.entity.name = path.join(this.dasherizedModuleName, this.dasherizedModuleName);
6262
options.flat = true;
6363
options.route = false;
6464
options.inlineTemplate = false;

tests/acceptance/generate-module.spec.js

+7
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,11 @@ describe('Acceptance: ng generate module', function () {
4949
expect(existsSync(path.join(testPath, 'my-module', 'my-module.module.spec.ts'))).to.equal(true);
5050
});
5151
});
52+
53+
it('ng generate module TwoWord', function () {
54+
return ng(['generate', 'module', 'TwoWord']).then(() => {
55+
expect(existsSync(path.join(testPath, 'two-word', 'two-word.module.ts'))).to.equal(true);
56+
expect(existsSync(path.join(testPath, 'two-word', 'two-word.module.spec.ts'))).to.equal(false);
57+
});
58+
});
5259
});

0 commit comments

Comments
 (0)