【发布时间】:2018-06-05 02:13:44
【问题描述】:
在我的项目中,我使用的是kendo-ui。因此在ngOnInit生命周期Hook
我正在尝试创建这样的东西:
ngOnInit() {
let hello = 600;
public bulletData: any[] = [200, this.hello];
public bulletValueAxis: any = {
min: 0,
max: this.hello
};
}
它不起作用!
全局对象和数组看不到外部的 var。有谁知道我该如何解决这个问题?
【问题讨论】:
-
只要把你好删除this.hello
-
ERROR ReferenceError: hello is not defined
标签: javascript angular scope