Hi all,
I am using this code
- import { NgModule, ModuleWithProviders } from '@angular/core';
- import { Routes, RouterModule } from '@angular/router';
- import { MainModule } from './main/main.module';
- import { AuthModule } from './auth/auth.module';
- const routes: Routes = [
- {path: '', redirectTo: 'auth', pathMatch: 'full'},
- {path: 'login' , redirectTo: 'auth' , pathMatch: 'full'},
- {path: 'auth', loadChildren: () => AuthModule }
- ];
- @NgModule({
- imports: [RouterModule.forRoot(routes)],
- exports: [RouterModule],
- })
- export class AppRoutingModule { }
It works with ng build but did not work with prod mode 'ng build --prod'


Sharad GuptaRank #111 · 20K reputationPosted Apr 4, 2018, 10:25 PM EDT
Kaushik DhameliyaRank #1,518 · 1K reputationPosted Apr 4, 2018, 10:19 PM EDT