javascript - 重构不再可用的 Angular `LoadedRouterConfig` 导入
问题描述
我有一个 Angular 应用程序,我正在升级到版本 8,并且LoadedRouterConfig
遇到了不再公开的问题。我找不到任何关于此的 Angular 文档,所以我不确定如何重新编写使用它的代码。似乎它正在动态创建动态路线?
import {LoadedRouterConfig} from '@angular/router/src/config';
.....
item.path = path;
item.children = [];
if (route.children !== undefined && route.children.length > 0) {
this.childrenProcess(route.children, path, item, context );
} else if (route.loadChildren !== undefined) {
const loadedRouterConfig: LoadedRouterConfig = (route as any)._loadedConfig;
if (loadedRouterConfig !== undefined ) {
this.childrenProcess(loadedRouterConfig.routes, path, item, context);
}
}
解决方案
推荐阅读
- odata - SAP云平台上的用户身份验证,用于未连接到SAP云的不同SAP系统上的业务用户
- reactjs - 有没有办法将 useSelector() 的结果作为道具传递给另一个组件?
- mysql - 不存在记录的多对多关系查询
- java - 在主函数中创建对象实例
- c++ - 如何在 C++ 中使用原子变量作为互斥锁?
- python - 由于 CUDA 错误,无法从 Keras 模型进行预测
- java - 如何从字符串中取出数字并消除这些数字并存储过滤后的字符串并在java中打印
- python - Python 位支持以提高可读性(如果可能)
- codeigniter - Capcha 图像使用 codeigniter 显示为空白
- sqlite - 如何制作动态的计算列?(斯威夫特,SQLite)