Add new flag `--sfc` to create standalone, inline template and inline style components
See original GitHub issueCommand
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:
- Created a year ago
- Reactions:36
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.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.