angular - loadChildren 是什么意思以及在 Ionic 4 中使用什么?
问题描述
我有以下问题:
我搬到了 Ionic 4,我可以看到它不是
{ path: '', component: WalkthroughComponent }
写的{ path: '', loadChildren: '/Walktrhough#WalkthroughModule'}
。我可以知道细节上的区别吗?我的应用程序没有那么大,根本不会有 25-30 条路线,我根本不想使用 loadChildren。你怎么看?Ionic 4 有 pages 的东西,这意味着你可以创建页面。我学习了 Angular,所以我只是在创建组件。所以主页也是一个组件。一切都是一个组成部分。这是错的吗?我可以在 Ionic 4 中遵循这个结构吗?
我对两者之间的区别感兴趣
this.navCtrl.navigateRoot("/error");
和
this.router.navigateRoot("/error");.
什么时候用哪个?
解决方案
推荐阅读
- javascript - Node.js 使用 mssql 访问数据库
- python - 消除面积比小于阈值python的连接像素数
- redux - Redux:通过创建浅拷贝来改变状态如何导致 reducer 出现问题?
- c - /dev/shm 中的文件在使用 ftruncate 增长但未写入时会占用内存吗?
- reactjs - 如何正确封装在 React 组件中?
- typo3 - cli_dispatch.phpsh(Extbase 命令)中的数据处理程序(TCEmain)
- file - 为什么我不能从崇高文本运行文件?
- react-native - 如何在功能组件内部的功能上使用 jest.spyOn
- c++ - 在 C++ 中隐藏不同的 std::map 比较参数
- python - 为什么此代码中的 elif 语句无效?