从ant +设备获取数据时,页面无法按时显示该信息。
ts的代码:
this.antplus.subscribeHR(ID, (response) => {
this.heartrate = response.heartRate;
}, (error)=>console.log("error:" + error));
HTML代码:
<ion-item>
<button ion-button (click)="stopSearch();">Stop</button>
{{heartrate}}
</ion-item>
心率的值只会在页面更改时更新。
这个问题我也遇到了ionic-Native / stepcounter