Have ng g c [name] generate inline-template and inline-style automatically from config
See original GitHub issueBug Report or Feature Request (mark with an x)
- [ ] bug report -> please search issues before submitting
- [X] feature request
Versions.
master
Repro steps.
ng new delete-me-quickly
cd delete-me-quickly/src/app
ng g c hello
cd hello && ls
Contains html and css files, instead of them being inline.
The log given by the failure.
Desired functionality.
If the functionality is specified in ng new using -is or -it, a respective setting should be saved in .angular-cli.json and stick in generation of new Components and/or Directives.
Mention any other details that might be useful.
I came up with it during research I’m doing for #6480, where I’m updating the documentation for ng new.
I would like to further contribute by adding this feature myself and PRing it. Would that be acceptable? Is this feature even discussed? I would very much like to contribute in the cli, especially something that is more code than docs.
EDIT
After additional research, I did find that .angular-cli.json has such configuration, as specified here:
/* blueprints/component/index.ts */
options.inlineStyle = options.inlineStyle !== undefined ?
options.inlineStyle : CliConfig.getValue('defaults.component.inlineStyle');
options.inlineTemplate = options.inlineTemplate !== undefined ?
options.inlineTemplate : CliConfig.getValue('defaults.component.inlineTemplate');
But it is not set during ng new.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (7 by maintainers)

Top Related StackOverflow Question
@Brocco I like the suggestion. Also I think that the existing flags documentation should be updated to explain they only cause AppComponent to be inline.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.