When I try to add automatic routing for components generated using following command
ng generate module orders --route orders --module app.module
I get the error
Couldn't find a route declaration in /src/app/app-routing.module.ts.
app-routing.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Routes } from '@angular/router';
@NgModule({
declarations: [],
imports: [
CommonModule
]
})
export class AppRoutingModule {
}
I also tried adding this line the app-routing file
export const routes: Routes = []
Still problem persits.How to fix this error?