I am currently working on an Angular project that includes a component named 'wrongRouteComponent' for a custom 404 page. Whenever a user enters a non pre-defined route, the 'wrong-route.component.html' should be displayed. However, I am not sure how to achieve this.
Below is the code snippet from my 'app-routing.module.ts' file:
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
// Required components for route services activation
import { LandingComponent } from '../../components/landing/landing.component';
import { DashboardComponent } from '../../components/dashboard/dashboard.component';
import { UserprofileComponent } from '../../components/userprofile/userprofile.component';
import { WrongRouteComponent } from '../../components/wrong-route/wrong-route.component';
const routes: Routes = [
{ path: '', component: LandingComponent},
{ path: '/dashboard', component: DashboardComponent},
{ path: '/userprofile', component: UserprofileComponent},
// Handling wrong routes by displaying the custom 404 page
{ path: '404', component: WrongRouteComponent},
];
I need assistance in making changes or additions to the following line of code within the routing configuration:
{ path: '404', component: WrongRouteComponent},