首页 > 解决方案 > 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:“调用者”、“被调用者”和“参数”属性可能无法在严格模式函数或调用它们的参数对象上访问

标签: angularroutes

解决方案


我不再使用 angular 8,但如果记忆对我有用,您不能延迟加载组件,只能延迟加载模块。


推荐阅读