Javascript 当向用户显示警报框时,ionic 3中是否有任何事件

Javascript 当向用户显示警报框时,ionic 3中是否有任何事件,javascript,angular,events,ionic-framework,Javascript,Angular,Events,Ionic Framework,我需要在ionic alert弹出窗口中显示图像(帮助图标)。我在应用程序中使用本地化。我现在所做的是使用CSS类从translate字符串中显示图像,如下所示 "PBMNotConnected": "<div>We didn't detect a PBM connected to your device.</div><p class='pbmAlertInfoBox'>Please select the <span class='infoIcon' (

我需要在ionic alert弹出窗口中显示图像(帮助图标)。我在应用程序中使用本地化。我现在所做的是使用CSS类从translate字符串中显示图像,如下所示

"PBMNotConnected": "<div>We didn't detect a PBM connected to your device.</div><p class='pbmAlertInfoBox'>Please select the <span class='infoIcon' (click)='goToHelp()'></span> (info icon) for help.</p>",
然后我尝试使用以下代码手动绑定事件

let alert = this.popUpService.presentAlert('error', undefined, 'PBMNotConnected', 'custom-popup-ok error', 'ok');
let elements: any = document.getElementsByClassName('.pbmAlertInfoBox .infoIcon');
  if(elements.length > 0){
     elements[0].click = () => {
       this.goToHelp();
     }
  }
但现在的问题是,我不知道警报弹出窗口的确切打开时间,因此我需要您的帮助,以了解打开警报弹出窗口后可用的任何事件


提前感谢。

我知道需要显示自定义警报,但如果您觉得奇怪,请尝试用您的方式解决。是什么阻止你仅仅使用“按钮”和消息属性的组合来实现你想要的?如果我理解正确,你建议使用简单模式来代替警报?或者对设计本身进行更改?我想我想说的是,alertController是非常可定制的:带有按钮、css、使用html模板的消息等。因此,使用所有这些实现您的目标应该没有问题。但根据您的代码,您正在尝试在调用alertController时获得实际的自定义设置。也许最好有一个预步骤方法,它可以创建所有定制,然后为您实例化带有这些选项的alertController?基本上你需要“getCustomization(conditions)”,然后((customizations)=>{this.presentAlert(customizations)})哦,好的……你能给我指一下任何演示示例,让我参考一下吗?
let alert = this.popUpService.presentAlert('error', undefined, 'PBMNotConnected', 'custom-popup-ok error', 'ok');
let elements: any = document.getElementsByClassName('.pbmAlertInfoBox .infoIcon');
  if(elements.length > 0){
     elements[0].click = () => {
       this.goToHelp();
     }
  }