Angular2 Not Recognizing component From Imported Module
You have to add the BreadcrumbComponent
to the exports array, and only import the CommonModule
. You can only import the BrowserModule once in your app (usually at the bootstrap module):
@NgModule({ imports: [ CommonModule ], declarations: [ BreadcrumbComponent ], exports: [ BreadcrumbComponent ]})export class BreadcrumbModule {}
Things inside the declarations
array are components/directives/pipes used within the module itself. If you want to expose these to other modules importing your module, then they should be added to the exports
array