Skip to content

refactor(@schematics/angular): remove hardcoded default values #15245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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