Update the app.module.ts

Update the app.module.ts file to use the Routing Module as follows:

. . .
import { AppRoutingModule } from './app-routing/app-routing.module';
@NgModule({
  . . .
  imports: [
    BrowserModule,
    AppRoutingModule
  ],
  . . .
})
. . .

Notice

  • the import of the { AppRoutingModule } from './app-routing/app-routing.module'; here.
  • the import of this AppRoutingModule in the imports array of the decorator @NgModule .