在 bootbox 回调中调用服务函数

Call a service function inside bootbox callback

voidfn = () => {
      bootbox.confirm("Are you sure you want to continue", function (result, apiService) {
          if (result == true) {

              let response = this.apiService.getVoid(systemId, orderId).subscribe(
                  success => {
                      this.spinner = false;
                      this.toastr.success("Success");
                  }, error => {
                      this.spinner = false;                

                  }
              );
          }
      });

  }

在此代码中,我无法访问 getVoid() 方法,因为 apiservicebootbox 调用中不可用。

有没有办法做到这一点。求推荐..

您好,我已经解决了箭头函数的上述问题

voidfn = () => {
      bootbox.confirm("Are you sure you want to continue", (result)=> {
          if (result == true) {

              let response = this.apiService.getVoid(systemId, orderId).subscribe(
                  success => {
                      this.spinner = false;
                      this.toastr.success("Success");
                  }, error => {
                      this.spinner = false;                

                  }
              );
          }
      });