【发布时间】:2019-03-10 11:58:23
【问题描述】:
这是我正在调用的函数:
refreshServices() {
this.services = this.monitorService.getServices(); }
我在构造函数中调用,像这样:
constructor(private localNotifications: LocalNotifications,
public monitorService: MonitorService) {
this.refreshServices(); }
这很好用,但是当我这样做时:
constructor(private localNotifications: LocalNotifications,
public monitorService: MonitorService) {
setInterval(this.refreshServices,100000); }
不起作用...这是控制台中的错误消息:
错误类型错误:无法读取未定义的属性“getServices”
那么,有什么想法吗?
【问题讨论】:
标签: angular ionic-framework ionic4