没有路由器插座的延迟加载角度模块不起作用

时间:2019-04-15 05:50:02

标签: angular angular2-routing lazy-loading angular-routing

我有一个Services惰性加载模块,并且在该模块内部,我还有一个惰性加载模块ServiceProvider

我可以使用父模块服务的router-outlet而不为子惰性模块定义单独的出口吗?

问题是我不想定义一个单独的组件将路由器插座放入子模块中。

这些是服务模块的路由。

export const SERVICES_ROUTES: Routes = [
      {
        path: '',
        component: ServicesComponent,
        children: [
          {
            path: 'list', component: ServicesListComponent,
          },
          {
            path: 'tips_and_laws_list', component: ConstructionTipsAndLawsListComponent,
          },
          {
            path: 'service_provider_list', loadChildren: './../services/service-providers/service-providers.module#ServiceProvidersModule',
          },
          {
            path: '', redirectTo: 'list', pathMatch: 'full'
          }
        ]
      }
    ];

当我导航到service_provider_list时,该模块内没有路由器出口。

服务提供商模块的路由。

export const SERVICES_PROVIDER_ROUTES: Routes = [
  {
    path: 'list',
    component: ServiceProviderListComponent,

  }
];

我可以在ServiceProviderListComponent内没有路由器出口的情况下加载ServiceProvidersModule吗?

0 个答案:

没有答案
相关问题