vscode-angular2-files icon indicating copy to clipboard operation
vscode-angular2-files copied to clipboard

Global defaults

Open scorp-dmitriy opened this issue 4 years ago • 6 comments

It would be extremely helpful if it's possible to predefine configurations instead of using -o flag and manually choose options.

I'm working with NX repo and extension cannot determine the correct repo config to use. For example, I use changeDetectionStrategy.OnPush everywhere. And it's pretty annoying to set it manually every time I generate a component. Same for styles: I think, 90% of developers use scss.

scorp-dmitriy avatar Apr 28 '20 10:04 scorp-dmitriy

Styling can be changed with the following command:

ng config schematics.@schematics/angular:component.styleext scss

jerone avatar Jul 29 '20 14:07 jerone

@jerone as I said, in nrwl nx repo it doesn't work

scorp-dmitriy avatar Jul 31 '20 10:07 scorp-dmitriy

This does work for me and my co-workers. There must be some other configuration on your side. Also, i don't know what this NX repo (link) is.

jerone avatar Jul 31 '20 14:07 jerone

@jerone NX is a tool for monorepos https://nx.dev/angular. It encapsulates some pieces of logic into separate libs. Because of that it looks like this plugin is not able to grab the config from angular.json and applies default params to the generated component.

Moreover, I'm always using changeDetectionStrategy.OnPush. In some projects I could not apply this as a default strategy in angular.json, so it was pretty annoying to manually do it each time I'm generating the component.

What I'm talking about is configuring the plugin by your personal needs not depending on angular.json. That way it always does what you want

scorp-dmitriy avatar Jul 31 '20 16:07 scorp-dmitriy

@scorp-dmitriy Currently this extension depends on angular.json for configurations, however, if not found it will just use default configs, need to look into nrwl to see how best to support it

ialexivy avatar Aug 08 '20 08:08 ialexivy

@ivalexa yeah, that's what I'm saying: would be ideal to be able to modify the default configs 🙂

scorp-dmitriy avatar Aug 08 '20 19:08 scorp-dmitriy