2017-02-25 77 views
0

我想爲其他子女子女創造一個子女子。我想我的項目的結構,在這種形式如何給二角子女的其他子女子

  1. approute logincomponent
    notfoundcomponent
    additionalroutingmodule(加載使用懶惰的路由)
  2. 額外的路由模塊 -othersubmodule(使用延遲加載加載) -other2submodule(使用延遲加載加載) 這裏是模塊代碼

    export const appRoutes: Routes = [ 
    { path: '', loadChildren: 'app/additional.module#AdditionalModule' }, 
    { path: 'login', component: LoginComponent }, 
    { path: 'change-password', component: ChangePasswordComponent }, 
    { path: 'not-allowed', component: NotAllowedComponent }, 
    { path: '**', component: NotFoundComponent }/**/ 
    
    ]; 
    

    附加模塊

    export const routes: Routes = [ 
        { 
         path: '', component: AppHomeComponent, children: 
         [ 
          { path: 'party', loadChildren: 'app/party/party.module#PartyModule' }, 
          { path: 'product', loadChildren: 'app/product/product.module#ProductModule' }, 
          { path: 'order', loadChildren: 'app/order/order.module#OrderModule' }, 
          { path: 'accounting', loadChildren: 'app/accounting/accounting.module#AccountingModule' } 
         ] 
        } 
    ]; 
    

所以在佈線時訪問additonalroutingmodule它不會得到路徑的子孩子什麼時候會顯示在括號 如新/新名單(舊錯誤/舊列表)

+0

找到了解決辦法 – hanini

回答

0

爲的AppModule給父路徑名就能解決問題