Hi
I am getting below error -
Code
Link 1
[ERROR] NG8001: 'router-outlet' is not a known element:
1. If 'router-outlet' is an Angular component, then verify that it is included in the '@Component.imports' of this component.
2. If 'router-outlet' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@Component.schemas' of this component to suppress this message. [plugin angular-compiler]
src/app/Pages/layout/layout.component.html:16:4:
16 ¦
thanks.

sasikala sRank #1,091 · 1.7K reputationPosted Nov 28, 2024, 1:03 AM EST
import { NgModule } from '@angular\/core'; import { BrowserModule } from '@angular\/platform-browser'; import { RouterModule } from '@angular\/router'; \/\/ Import RouterModule import { AppComponent } from '.\/app.component'; @NgModule({ declarations: [ AppComponent, \/\/ other components ], imports: [ BrowserModule, RouterModule.forRoot([]) \/\/ Initialize routing ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }