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

Asked

Viewed 108 times

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

Bemvindo.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’m unable to use the app-Inbound component within the app-Dashboard component.

Note: I am importing both modules into my app.module.ts.

I have tried to export both the component and the module in my app-bemvindo.module and import into dashboard.module, but you still don’t recognize.

What’s wrong with my structure?

1 answer

1

To use the component of a module within another module you have to add it to the Xports.

declarations: [MeuComponent],
exports: [MeuComponent]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.