I have my app-routing.module.ts as follow:
import { NgModule } from '@angular/core';
import {
Routes,
RouterModule
} from '@angular/router';
const routes: Routes = [
{
path : 'reset',
loadChildren: 'app/auth/reset-password-form/reset-password-form.module#ResetPasswordFormModule'
},
{
path : 'verify',
loadChildren: 'app/auth/verify-user-form/verify-user-form.module#VerifyUserFormModule'
},
{
path : '404',
loadChildren: 'app/route-not-found/route-not-found.module#RouteNotFoundModule'
},
{
path : '',
pathMatch : 'full',
loadChildren: 'app/landing-page/landing-page.module#LandingPageModule'
},
{
path : '**',
redirectTo: '/404'
},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule {
}
When I navigate to the localhost:4200, it will load the landing-page.module properly, however, when I entered localhost:4200/reset or localhost:4200/verify or localhost:4200/404, it will not load the relevant module, instead, it loaded landing-page.module automatically.
How can I solve this problem?