-
Notifications
You must be signed in to change notification settings - Fork 155
feat(@schematics/angular): save ng new options as defaults #666
Conversation
Do you think this is the right location to save the options? I know that it is working to set these options on schematics but shouldn't these be set at application / library scope? For example the |
@Brocco can you have a look? |
Don't think the bazel failure is due to this PR. About the location of the defaults options, the |
// tslint:disable-next-line:no-any | ||
const schematics: any = {}; | ||
|
||
if (options.inlineTemplate !== undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
none of these should ever be undefined since the schema contains default values for all the options referenced here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure? I supposed options
was the ones passed in the cli command, as the types are x | undefined
. If so, it's just a quick fix, I will correct the PR later today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@cyrilletuzi Yes, sounds reasonable :) I created a separate PR for prefixes: #685 |
@@ -223,6 +223,36 @@ function addAppToWorkspaceFile(options: ApplicationOptions, workspace: Workspace | |||
// } | |||
|
|||
workspace.projects[options.name] = project; | |||
|
|||
// tslint:disable-next-line:no-any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove any
, use JsonObject
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used any
because it is what is done just above for project
. Changed to JsonObject
as request in last commit, but forced me to cast each property.
const schematics: any = {}; | ||
|
||
if (options.inlineTemplate === true | ||
|| options.inlineStyle === true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent by 4 spaces.
@hansl requested changes done :) |
Reintroduced #196 in schematics for CLI v6.
Fixes #615
@filipesilva @hansl @Brocco Could you review and merge this, so it it's part of the v6 final release? Thanks.