Skip to content

Commit d7b9650

Browse files
alan-agius4Keen Yee Liau
authored andcommitted
refactor(@schematics/angular): remove hardcoded default values
Defaults in code are no longer required as the root issue was solved by #15222
1 parent 9478ee9 commit d7b9650

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

packages/schematics/angular/application/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,6 @@ export default function (options: ApplicationOptions): Rule {
306306
throw new SchematicsException(`Invalid options, "name" is required.`);
307307
}
308308
validateProjectName(options.name);
309-
options.prefix = options.prefix || 'app';
310-
// This line and the one above shouldn't be needed, but at the moment they are.
311-
// This is because the default value defined in the schema.json file is not
312-
// correctly set when this schematic is run from another schematic.
313-
options.style = options.style || Style.Css;
314309
const appRootSelector = `${options.prefix}-root`;
315310
const componentOptions: Partial<ComponentOptions> = !options.minimal ?
316311
{

packages/schematics/angular/library/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ function addAppToWorkspaceFile(
139139
root: projectRoot,
140140
sourceRoot: `${projectRoot}/src`,
141141
projectType: ProjectType.Library,
142-
prefix: options.prefix || 'lib',
142+
prefix: options.prefix,
143143
targets: {
144144
build: {
145145
builder: Builders.NgPackagr,
@@ -178,7 +178,7 @@ export default function (options: LibraryOptions): Rule {
178178
if (!options.name) {
179179
throw new SchematicsException(`Invalid options, "name" is required.`);
180180
}
181-
const prefix = options.prefix || 'lib';
181+
const prefix = options.prefix;
182182

183183
validateProjectName(options.name);
184184

0 commit comments

Comments
 (0)