Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 在第10章中,请一起使用bypassSecurityTrustHtml和bypassSecurityTrustScript_Angular - Fatal编程技术网

Angular 在第10章中,请一起使用bypassSecurityTrustHtml和bypassSecurityTrustScript

Angular 在第10章中,请一起使用bypassSecurityTrustHtml和bypassSecurityTrustScript,angular,Angular,我必须在离子卡上显示之前更改数据,因为我使用的是管道,这部分工作正常。问题是我必须在自动创建的链接中启用单击功能 <ion-card-subtitle [innerHTML] = 'Data.description | tagShow'></ion-card-subtitle> transform(value: any): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl { if (

我必须在离子卡上显示之前更改数据,因为我使用的是管道,这部分工作正常。问题是我必须在自动创建的链接中启用单击功能

<ion-card-subtitle [innerHTML] = 'Data.description | tagShow'></ion-card-subtitle>


transform(value: any): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl {

    if (this._PatternService._Pattern__tagCorreiosG.test(value)) {
      this.correios = value.match(this._PatternService._Pattern__tagCorreios)[2];

      this.correiosLink = `<span id="correiosLink">${this.correios}</span> <ion-icon name="copy-outline" class="is__ml-2" (click)="copy()"></ion-icon>`; 
    }

    return this._DomSanitizer.bypassSecurityTrustHtml(this.correiosLink);
  }

copy() {
    alert('OK');
  }

转换(值:任意):安全HTML |安全样式|安全脚本|安全URL |安全资源URL{
if(此模式服务模式测试(值)){
this.correios=value.match(this._PatternService._Pattern_uutagcorreios)[2];
this.correiosLink=`${this.correios}`;
}
返回此。\u domsanizer.bypassSecurityTrustHtml(this.correiosLink);
}
副本(){
警报(“正常”);
}
模式来检查值是否有效,数据是否被发送回DOM,问题是我需要启用click函数,但它不起作用,因为我只使用了bypassSecurityTrustHtml。有没有办法一起使用bypassSecurityTrustHtml和bypassSecurityTrustScript