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