question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add new flag `--sfc` to create standalone, inline template and inline style components

See original GitHub issue

Command

generate

Description

After Standalone components rolled out in v14, many of the angular devs started using single file standalone components as default. They just look cleaner, less number of files and forces us to create simple components i.e. don’t put too much in single file, hence increases the re-usability and readability

At present we use

ng generate component COMPONENT_NAME --standalone --inline-style --inline-template

this can be simplified to

ng generate component COMPONENT_NAME --sfc

Describe the solution you’d like

add a new flag called --sfc to CLI that creates standalone, inline template and inline style component

Describe alternatives you’ve considered

At present we supply 3 flags to achieve this behaviour

ng generate component COMPONENT_NAME --standalone --inline-style --inline-template

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:36
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
dgp1130commented, Sep 15, 2022

Yes, we did recently chat about merging these two options. I think @alxhub wanted a different name than --sfc, but I forget what his preference was.

I’m fully in support of merging the options. 99% of the time users use them together anyways.

We’d probably start out without standalone (though we’d probably support --sfc --standalone). If we ever decide to do standalone by default, then that would probably also apply to --sfc in the same way.

0reactions
angular-robot[bot]commented, Sep 15, 2022

This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we’ll move it to our consideration list.

You can find more details about the feature request process in our documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generate component with inline template and style using ...
For inline templates, we need to add --inlineTemplate=true. By default its value is false. For inline style, we need to add --inlineStyle=true.
Read more >
Inline Template and Inline Styles as Defaults in Angular CLI
So here is how to set inline templates and inline styles, which is my preference for creating Angular applications.
Read more >
Twitter
Add new flag --sfc to create standalone, inline template and inline style components ... Command generate Description After Standalone components rolled out in ......
Read more >
Angular Component Schematic Flags You Didn't Know Exist
It's going to create a new component of type page. ... This generates a component with an inline styles array defined within the...
Read more >
How To Generate a Vue.js Single Page App With the Vue CLI
Vue.js is a popular JavaScript framework for creating user interfaces, ... Along the way, you will create .vue single-file components (SFC), ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found