App Routing module.
...
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
...
import { ComponentName } from './pathtocomponent';
@NgModule({
...
imports: [
...
AppRoutingModule
],
]
})
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ComponentName } from './pathtocomponent';
const appRoutes: Routes = [
{ path: '', component: ComponentName'},
/*{ path: 'not-found', component: PageNotFoundComponent },
{ path: '**', redirectTo: '/not-found' }*/
];
/* @NgModule Transform this file in an angular module*/
@NgModule({
imports: [RouterModule.forRoot(appRoutes)], /* Register router in the app*/
exports: [RouterModule] /* Exports the router module */
})
export class AppRoutingModule {
}