-2
How do I have in different modules, the same component in the declarations?
Ex:
estado.modulets.
@NgModule({
imports: [...],
declarations: [ AdicionarEstado, ... ]
...
})
city.modulets.
@NgModule({
imports: [...],
declarations: [ AdicionarEstado, ... ]
...
})
I need this because I will have a select that, your first item will be a fixed button that will open a modal to register a state, besides bringing the registered ones. This will be done on the city register... (when necessary).
EDIT
With import from the state in the city
city.modulets.
@NgModule({
imports: [ EstadoModule, ...],
declarations: [ ... ]
...
})
You can put the Added in the declarations and in the State Exports, and then add the State in the City as it was exported by the Statedule can be used in the Citiquedule that is importing everything that is declared in the State. Have you tried it? I believe it will solve your problem.
– Lucas Ayrosa
I did that, but when I open the view of the city, the state is loaded...
– LeoHenrique
I put an example for you to see
– LeoHenrique
Dude, Angular doesn’t allow you to declare 1 component in two different modules... what you can do is to encapsulate your component in another module, but I don’t have ctz if I understand your question.
– cezar
I put this on Edit, I tried to do with the module import, but when I load a city view in the case, it opens a state view...
– LeoHenrique
The idea is to register a state within the city view, using a modal, I described this also in the post...
– LeoHenrique