I am getting this error when I am trying to add RouterModule.forRoot(appRoutes) line in my app.module.ts. Below are my app.module.ts file
app.module.ts file.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import {RouterModule} from '';
import { AppComponent } from './app.component';
import { HeaderComponent } from './header/header.component';
import { AboutComponent } from './about/about.component';
import { CoursesComponent } from './courses/courses.component';
import {FormsModule} from '@angular/forms';
import {RouterModule, Routes} from '@angular/router';
const appRoutes: Routes = [
{path:'',component:HeaderComponent},
{path:'about',component:AboutComponent},
{path:'courses',component:CoursesComponent}
];
@NgModule({
declarations: [
AppComponent,
HeaderComponent,
AboutComponent,
CoursesComponent
],
imports: [
BrowserModule,
FormsModule,
RouterModule.forRoot(appRoutes)
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }