Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable selector during component generation #14749

Closed
SamanthaAdrichem opened this issue Jun 12, 2019 · 1 comment · Fixed by #14782
Closed

Disable selector during component generation #14749

SamanthaAdrichem opened this issue Jun 12, 2019 · 1 comment · Fixed by #14782
Labels
area: @schematics/angular feature Issue that requests a new feature
Milestone

Comments

@SamanthaAdrichem
Copy link
Contributor

🚀 Feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Description

A clear and concise description of the problem or missing capability...

I might be in the wrong here for how angular is intended to work, for us though we'd prefer to have a separation between 'view components' (those loaded by routing) and 'element components' (those used where you want).

Since Angular 4 it is possible to have components that do not have a selector specifically for routing. How ever with Angular-Cli it is not possible to generate a component without a selector.

The current selectors might actually cause collissions for us due to this separation, for a view selector can be identical to a component selector. (Though so far this never happened!)

Describe the solution you'd like

If you have a solution in mind, please describe it.

Eather: Add the --skip-selector param which would generate the component identical to every other component and just doesn't add the selector in the decorator
Or: Add the --routed-component param, which in the future might add other features that are required for routed components (though I do not know of any other differences then adding it to the routing module)

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?

I've currently written a custom schematic that calls the the angular component generator but first adds a separate prefix app-view so that we can instantly recognize them as that they should not be re-used inside other views.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @schematics/angular feature Issue that requests a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants