首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cordova-plugin-antplus不适用于离子3。

cordova-plugin-antplus不适用于离子3。
EN

Stack Overflow用户
提问于 2018-12-15 14:03:41
回答 1查看 74关注 0票数 1

这是我的密码:

代码语言:javascript
复制
public antplus: any;
public SelectId: any;

constructor(public navCtrl: NavController) {
    this.antplus = (<any>window).antplus;
    this.antplus.searchDevices('HEARTRATE', function(device) {
        console.log(JSON.stringify(device));
        console.log("Ant ID=" + device.antDeviceNumber);
        this.SelectId = device.antDeviceNumber;
    },(error)=>{console.log("Error Search="+error);});
}

在控制台上将显示信息:控制台(64) "Ant ID=4077“。

但是也会得到错误消息:在“成功”中,callbackId: Antplus1239198979 : TypeError:无法设置属性'SelectId‘为null。

以前有人遇到过这个问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-12-16 07:39:30

代码语言:javascript
复制
    public antplus: any;
    public SelectId: any;

    constructor(public navCtrl: NavController) {
      this.antplus = (<any>window).antplus;
      this.antplus.searchDevices('HEARTRATE', (device) => {
      console.log(JSON.stringify(device));
      console.log("Ant ID=" + device.antDeviceNumber);
      this.SelectId = device.antDeviceNumber;
      },(error) => {
         console.log("Error Search="+error);
      });
    }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53793909

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档