【发布时间】:2020-01-22 20:37:06
【问题描述】:
一段时间后我得到了一些数据,我想将这些数据合并/替换为之前收到的数据,但它不起作用。 这是我如何替换原始结果数据。
result: Observable<SmsResponse>;
constructor() {
this.result = Plugins.SmsaccessPlugin.getAllSms({ value: "inbox"});
}
@HostListener("document:myCustomEvent", ["$event"])
on(event: any) {
var msg:Observable<SmsResponse> = of(event);
this.result=msg;//<--- here, but template not showing this new data
}
在 html 模板上,它与异步管道 (result | async) 一起使用。
(或者有什么方法可以从电容中获取数据?)
【问题讨论】:
标签: angular typescript ionic-framework ionic4 capacitor