I have a navbar component that I've organized into a module called 'NavbarModule' so that it can be easily shared. My goal is to use this component in the 'ProductsListComponent'. However, even after properly importing and exporting NavbarComponent in NavbarModule and importing NavbarModule in ProductsListComponent, I keep getting the error message 'app-navbar' is not a known element.
navbar.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NavbarComponent } from './navbar.component';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { Routes } from '@angular/router';
import { BrowserModule } from '@angular/platform-browser';
@NgModule({
declarations: [NavbarComponent],
imports: [
CommonModule,
FontAwesomeModule,
BrowserModule
],
exports:[
NavbarComponent
]
})
export class NavbarModule { }
product-list.module.ts
import { NavbarComponent } from 'src/app/components/navbar/navbar.component';
import { NavbarModule } from 'src/app/components/navbar/navbar.module';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ProductsListRoutingModule } from './products-list-routing.module';
import { ProductsListComponent } from './products-list.component';
@NgModule({
declarations: [ProductsListComponent],
imports: [
CommonModule,
ProductsListRoutingModule,
NavbarModule,
]
,exports:[ProductsListComponent]
})
export class ProductsListModule { }