Skip to content

Commit

Permalink
fix(@angular/cli): Generating component considers default style exten…
Browse files Browse the repository at this point in the history
…sion for project now
  • Loading branch information
AhsanAyaz authored and Brocco committed Sep 22, 2017
1 parent 2da72e5 commit 4d0c93e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions packages/@angular/cli/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ export default Command.extend({
if (commandOptions.prefix === undefined) {
commandOptions.prefix = appConfig.prefix;
}

if (schematicName === 'component' || schematicName === 'c') {
if (commandOptions.styleext === undefined) {
commandOptions.styleext = CliConfig.getValue('defaults.styleExt');
}
}
}

const SchematicRunTask = require('../tasks/schematic-run').default;
Expand Down
3 changes: 1 addition & 2 deletions packages/@angular/cli/tasks/schematic-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ function prepOptions(schematic: Schematic<{}, {}>, options: SchematicOptions): S

const properties = (<any>schematic.description).schemaJson.properties;
const keys = Object.keys(properties);

if (schematic.description.name === 'component') {
if (['component', 'c', 'directive', 'd'].indexOf(schematic.description.name) !== -1) {
options.prefix = (options.prefix === 'false' || options.prefix === '')
? '' : options.prefix;
}
Expand Down

0 comments on commit 4d0c93e

Please sign in to comment.