Closed. This question needs details or clarity 。它目前不接受答案。












想改善这个问题吗?添加细节并通过 editing this post 澄清问题。

1年前关闭。



Improve this question




我想导入我在应用程序中创建的模块以加载到某个路由上,该路由内有自己的路由

最佳答案

您需要在自定义模块的 Routes.forChild(routes) 文件中包含 .module.ts
然后在你的主路由中懒惰地加载你的模块

import { CustomModule } from 'your-path'
const routes: Routes = [
  {

      path: 'your-path', loadChildren: () => CustomModule

  }
];

关于javascript - 如何在 Angular 8 的路线上加载模块?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58009045/

10-11 22:28
查看更多