angular - loadchildren in different routing module -


i have been trying again many methods , stuck new scenario

below app.module.ts

export const routes: routes=[     {        path: '', component: logincomponent},     {        path: 'maincontent',        loadchildren: './main-content/maincontent.module#maincontentmodule'     }] 

below maincontent.module.ts

export const routes: routes = [   {     path: 'maincontent',     component: maincontentcomponent,     children: [       { path: 'dashboard',          loadchildren: './dashboard/dashboard.module#dashboardmodule' },     ]        }]; 

in dashboard.module.ts have following routes

export const routes: routes = [   {     path:'dashboard', component:dashboardcomponent,     children:[       {         path:'application',component:applicationdetailscomponent       }     ]   } ] 

the problem when login have navigated directly dashboard page , doesn't show contents of page . going wrong can guide me please

i think should make path child routes empty string

maincontent.module.ts

export const routes: routes = [   {     path: '', // instead of path: 'maincontent',     component: maincontentcomponent,     children: [       {         path: 'dashboard',         loadchildren: './dashboard/dashboard.module#dashboardmodule'       },     ]   }]; 

dashboard.module.ts

export const routes: routes = [   {     path: '', // instead of path: 'dashboard'     component: dashboardcomponent,     children: [       {         path: 'application', component: applicationdetailscomponent       }     ]   } ] 

plunker example


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -