Whenever I attempt to set up automatic routing for components that have been created using the command below
ng generate module orders --route orders --module app.module
I encounter the following error message
The requested URL /src/app/app-routing.module.ts could not be found.
In my app-routing.module.ts file, I have included the following code
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Routes } from '@angular/router';
@NgModule({
declarations: [],
imports: [
CommonModule
]
})
export class AppRoutingModule {
}
I also attempted to add this line in the app-routing file
export const routes: Routes = []
However, the issue still persists. Can someone please advise on how to resolve this error?