解决方法见https://blog.csdn.net/u010564430/article/details/53815702

 <iframe class="all-iframe" [src]="srcUrl"></iframe>  

ionic有安全显示,不能设置任意url,包括img、iframe等。

处理方法:

1.在对应ts文件中,导入DomSanitizer

import {DomSanitizer} from '@angular/platform-browser';

2.引用DomSanitizer

export class WebPage {
  srcUrl:any;
  constructor(private sanitizer: DomSanitizer) {
    this.srcUrl = this.sanitizer.bypassSecurityTrustResourceUrl(navParams.get('url'));
  }

注意:srcUrl类型为any,不能是string了。