Skip to content

Commit

Permalink
refactor(@schematics/angular): remove hardcoded default values
Browse files Browse the repository at this point in the history
Defaults in code are no longer required as the root issue was solved by angular#15222
  • Loading branch information
alan-agius4 authored and Keen Yee Liau committed Aug 8, 2019
1 parent 9478ee9 commit d7b9650
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions packages/schematics/angular/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,6 @@ export default function (options: ApplicationOptions): Rule {
throw new SchematicsException(`Invalid options, "name" is required.`);
}
validateProjectName(options.name);
options.prefix = options.prefix || 'app';
// This line and the one above shouldn't be needed, but at the moment they are.
// This is because the default value defined in the schema.json file is not
// correctly set when this schematic is run from another schematic.
options.style = options.style || Style.Css;
const appRootSelector = `${options.prefix}-root`;
const componentOptions: Partial<ComponentOptions> = !options.minimal ?
{
Expand Down
4 changes: 2 additions & 2 deletions packages/schematics/angular/library/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function addAppToWorkspaceFile(
root: projectRoot,
sourceRoot: `${projectRoot}/src`,
projectType: ProjectType.Library,
prefix: options.prefix || 'lib',
prefix: options.prefix,
targets: {
build: {
builder: Builders.NgPackagr,
Expand Down Expand Up @@ -178,7 +178,7 @@ export default function (options: LibraryOptions): Rule {
if (!options.name) {
throw new SchematicsException(`Invalid options, "name" is required.`);
}
const prefix = options.prefix || 'lib';
const prefix = options.prefix;

validateProjectName(options.name);

Expand Down

0 comments on commit d7b9650

Please sign in to comment.