angular - window['angularComponentReference'] 显示类型错误
问题描述
我正在尝试在 Angular 项目中使用 NgZone:
constructor(
private fishboneService: FishboneService,
private zone: NgZone,
) {
window['angularComponentReference'] = {
zone: this.zone,
componentFn: (value: any) => this.getDataFromOutside(value),
component: this
};
console.log('reference added');
}
但我收到以下错误:
元素隐式具有“任何”类型,因为索引表达式不是“数字”类型。
19 窗口['angularComponentReference'] = {
解决方案
推荐阅读
- java - 如何调用 Drools excel 决策表函数
- python - 如何使用文本文件作为模板?
- visual-studio - 以编程方式在 Visual Studio 的配置管理器中为项目勾选“构建”
- c - 将常规彩色图像转换为模糊版本
- node.js - 布局未显示单独的路线文件
- javascript - 制作自适应 iframe,然后在单击按钮时允许全屏显示
- hadoop - 无法为 hadoop (win7) 启动 namenode
- python-3.x - 需要帮助大学一年级的家庭作业问题涉及循环
- c++ - 静态库中的多重定义
- sharepoint - sharepoint 流条件未运行,显示“输入表达式错误”