Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用#或导入调用Angular 8的路由模块中的模块_Angular_Module_Lazy Loading - Fatal编程技术网

使用#或导入调用Angular 8的路由模块中的模块

使用#或导入调用Angular 8的路由模块中的模块,angular,module,lazy-loading,Angular,Module,Lazy Loading,我正在用Angular编写一个应用程序,并实现惰性加载。我发现有三种方法可以做到: 第一个: const routes: Routes = [ { path: 'customer-list', loadChildren: () => import('./customers/customers.module').then(m => m.CustomersModule) }, { path: 'order-list', loadChildren:

我正在用Angular编写一个应用程序,并实现惰性加载。我发现有三种方法可以做到:

第一个:

const routes: Routes = [
    { path: 'customer-list',
      loadChildren: () => import('./customers/customers.module').then(m => m.CustomersModule) },
    { path: 'order-list',
      loadChildren: () => import('./orders/orders.module').then(m => m.OrdersModule) }
    ];
第二个

const routes: Routes = [
    { path: 'customer-list',
      loadChildren: () => './customers/customers.module#CustomersModule'
    { path: 'order-list',
      loadChildren: () => './orders/orders.module#OrdersModule'
    ];
最后一个呢

const routes: Routes = [
    { path: 'customer-list',
      loadChildren: () => CustomersModule
    { path: 'order-list',
      loadChildren: () => OrdersModule
    ];
有人知道有什么区别吗?多谢各位