'app-welcome' is not a known element Angular 2+

1

My components are organized as follows:

app.module

src/
App.Module.ts: Importa os módulos dos componentes <br>
App.Routing.module.ts: Rotas raiz do sistema

welcome.module

src/app/components/ <br>
bemvindo -> <br>
bemvindo.module.ts (Aqui eu importo o meu componente) <br>
bemvindo.routing.module.ts (Aqui estão as rotas deste componente)<br>
bemvindo.component.ts <br>
bemvindo.component.html<br>

dashboard.module

dashboard.module.ts (Aqui eu importo o meu componente) <br>
dashboard.routing.module.ts (Aqui estão as rotas deste componente)<br>
dashboard.component.ts <br>
dashboard.component.html

The problem is that I am not able to use the app-welcome component inside the app-dashboard component.

Note: I'm importing both modules in my app.module.ts .

I've tried exporting both the component and the module in my app-bemvindo.module and importing it into dashboard.module , but it still does not recognize it.

What's wrong with my structure?

    
asked by anonymous 28.06.2018 / 16:27

1 answer

1

To use the component of a module inside another module you have to add it to the exports.

declarations: [MeuComponent],
exports: [MeuComponent]
    
28.06.2018 / 16:43