angular - Angular typeError:“调用者”、“被调用者”和“参数”属性可能无法在严格模式函数或参数对象上访问
问题描述
在 Angular 8 中,当我在下面为组件添加路由时,在此内部,router.config 出现以下错误。
let test = { path: 'sample', loadChildren: () =>
import("./screens/sample/sample.component").then(m => m.sampleComponent) } as Route;
this.router.config.push(test);
typeError:“调用者”、“被调用者”和“参数”属性可能无法在严格模式函数或调用它们的参数对象上访问
解决方案
我不再使用 angular 8,但如果记忆对我有用,您不能延迟加载组件,只能延迟加载模块。
推荐阅读
- javascript - 如何在浏览器控制台上从 js 模块调用函数
- javascript - 如何使用字符串名称作为函数调用?如果 string = 'sum' 并且函数是 sum(a, b)?
- python - pandas_udf 给出与 pyarrow 相关的错误
- python - 如何转换为对数基数 2?
- passwords - 如何使用 apache nifi 解压缩受密码保护的 zip 文件
- javascript - 在选择反应中获取数据
- python - 数据框中固定时间窗口的滚动平均值
- php - 在 Laravel 中使用 IsAdmin 中间件时出现未定义的方法错误
- python - 如何在 Python 中模拟 XMM 寄存器行为
- php - 如何在 VScode 中使用 PHP 代码创建 .txt 文件