首页 > 解决方案 > 在本机脚本 Angular 中接收来自模态的两个回调

问题描述

我想在关闭模态时发回两个参数,我可以成功取回一个参数,下面的代码是我尝试过的,但它不起作用,我在互联网上找不到太多,感谢任何帮助谢谢。

 onHandleInput(action: string, id: number) {
  this.modalParams.closeCallback(action,id);
}

 changePerson(index) {
    //open up modal for choosing an exercise
    this.modalDialog.showModal(PersonListModalComponent, {
     fullscreen: false,
    viewContainerRef: this.uiService.getRootVCRef() ? this.uiService.getRootVCRef() : this.vcRef, context: {}})
    .then(({action,id}) => {this.personName = action,this.personId = id ,this.updatePersonChange(index)});
  }

标签: javascriptangularnativescript

解决方案


推荐阅读