Skip to content

Have ng g c [name] generate inline-template and inline-style automatically from config #6570

@gioragutt

Description

@gioragutt

Bug 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.

Metadata

Metadata

Assignees

Labels

featureIssue that requests a new feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions