Skip to content

Commit

Permalink
fix(generate): revert change to component dir in generate module, as …
Browse files Browse the repository at this point in the history
…it caused component declaration to go to parent module
  • Loading branch information
Meligy committed Nov 16, 2016
1 parent 07e96ea commit 8026eb7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/angular-cli/blueprints/module/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ module.exports = {
},

afterInstall: function (options) {
options.entity.name = path.relative(this.dynamicPath.appRoot, this.generatePath);
options.flat = false;
// Note that `this.generatePath` already contains `this.dasherizedModuleName`
// So, the path will end like `name/name`,
// which is correct for `name.component.ts` created in module `name`
const componentPath = path.join(this.generatePath, this.dasherizedModuleName);
options.entity.name = path.relative(this.dynamicPath.appRoot, componentPath);
options.flat = true;
options.route = false;
options.inlineTemplate = false;
options.inlineStyle = false;
Expand Down

0 comments on commit 8026eb7

Please sign in to comment.