Skip to content

Disable selector during component generation #14749

Closed
@SamanthaAdrichem

Description

@SamanthaAdrichem

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions