【发布时间】:2021-06-16 11:20:00
【问题描述】:
如何在 Angular 11 中停止 iframe console.log,
我有
尝试 1:
<iframe width="100%" height="100%" [src]="myurl" frameborder="0" allowfullscreen #chatRoom ng-onload="setChatRoom()"></iframe>
setChatRoom() {
console.log = function() {console.log('no log')}
}
尝试 2:
@ViewChild('chatRoom', {static: false}) chatRoom: ElementRef;
ngAfterViewInit() {
this.chatRoom.nativeElement.el.console.log = function() {}
}
尝试了 3:
<iframe width="100%" height="100%" [src]="myurl" frameborder="0" allowfullscreen #chatRoom ng-onload="setChatRoom()"></iframe>
setChatRoom() {
this.chatRoom.nativeElement.el.console.log = function() {}
}
【问题讨论】:
-
我无法控制 iframe
标签: typescript iframe console.log angular11