Add `exportAs` when using ng generate component / directive
🚀 Feature request
Command (mark with an x)
- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] extract-i18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Description
It would be nice being able to configure ng generate component/ng generate directive schematics to add exportAs to the decorator metadata with a camelcase version of the selector.
Describe the solution you'd like
- Automatic
exportAsbased on selectorng generate component my-new-component --export-asProduces
@Component({
selector: 'app-my-new-component`,
exportAs: 'appMyNewComponent',
// [...]
})
- Custom
exportAsng generate component my-new-component --export-as="newComponent"Produces
@Component({
selector: 'app-my-new-component`,
exportAs: 'newComponent',
// [...]
})
- Configurable schematics in
angular.json
"schematics": {
"@schematics/angular:component": {
"exportAs": "camelcase" // "camelcase" | false (default)
}
},
Describe alternatives you've considered
Have you considered any alternative solutions or workarounds?
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.
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
Thanks for submitting this request. Let’s reconsider this in the future if there is a larger desire for it from the community.
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.