0

I have a directory structure as shown in image

https://i.stack.imgur.com/yitTd.png

When I use <app-news-card> selector in app.component.html, it shows error of <app-news-card> not present in current module.

How should I fix this in the most best practical way.

Currently: I am

1.)exporting news-card.component from news.module

2.)then I have imported NewsModule in current.module with re-exporting NewsModule

3.)and then I have imported CurrentModule in app.module

Padmesh
  • 17
  • 5
  • Solution found from this thread: [https://stackoverflow.com/questions/46381730/angular-exported-component-from-module-not-useable-in-another-module](https://stackoverflow.com/questions/46381730/angular-exported-component-from-module-not-useable-in-another-module) – Padmesh May 05 '20 at 11:10

1 Answers1

0

Make sure that you have the news card component in your declarations of your news.module. For example:

@NgModule({
  declarations: [NewsCardComponent],
  imports: [...],
  exports: [NewsCardComponent]
})

More information about boostrapping can be found here: Docs

Jan Krüger
  • 786
  • 1
  • 5
  • 16