Html 如何使用iframe标签打开新窗口并在facebook页面内显示?

Html 如何使用iframe标签打开新窗口并在facebook页面内显示?,html,angular,iframe,Html,Angular,Iframe,我是angular2的新手,我已经创建了angular2应用程序。 我的angular2应用程序有一些问题(对不起,我的英语)。。(查看图片) 1.我显示了父窗口,然后单击父窗口按钮打开一个新窗口,工作正常。 2.但是,我尝试使用iframe标记在新窗口内显示页面。但是,没有修复它 任何人都可以帮我 parent.component.html <div><a href="javascript:void(0);" (click)="window.open()">click

我是angular2的新手,我已经创建了angular2应用程序。

我的angular2应用程序有一些问题(对不起,我的英语)。。(查看图片)
1.我显示了父窗口,然后单击父窗口按钮打开一个新窗口,工作正常。
2.但是,我尝试使用iframe标记在新窗口内显示页面。但是,没有修复它
任何人都可以帮我
parent.component.html

<div><a href="javascript:void(0);" (click)="window.open()">click Me</a></div>
<iframe #window="child"></iframe>

子组件.ts

import { Component } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { DomSanitizer } from "@angular/platform-browser";

@Component({
    selector: 'iframe',
    template: `<div>
    <h4>Angular2 app </h4>
     <iframe width="100%" height="300" [src]="pdfUrl"></iframe>
    </div>`,
    exportAs: 'child',
})
export class IframeComponent {
    pdfUrl;
    constructor(private domSanitizer: DomSanitizer) { 
  this.pdfUrl = this.domSanitizer.bypassSecurityTrustResourceUrl('https://www.facebook.co'); // how to dispaly the inside window?
    }

    open() {
        window.open('http://localhost:4200/SEA/mainpage','_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes')     //this is working fine
    }
}
从'@angular/core'导入{Component};
从“@angular/platform browser”导入{BrowserModule};
从“@angular/platform browser”导入{domsanizer}”;
@组成部分({
选择器:“iframe”,
模板:`
Angular2应用程序
`,
exportAs:'儿童',
})
导出类IframeComponent{
pdfUrl;
构造函数(私有domsanizer:domsanizer){
this.pdfUrl=this.domsanizer.bypassSecurityTrustResourceUrl('https://www.facebook.co);//如何显示内窗?
}
开(){
打开窗户http://localhost:4200/SEA/mainpage“,”空白“,”位置=yes,高度=570,宽度=520,滚动条=yes,状态=yes')//这工作正常
}
}

您是否尝试过
?(:@ErhanYaşar,已用于facebook.com">…,我的问题是单击父窗口上的一个按钮,同时使用facebook窗口显示新的子窗口和iframe标记。您可以共享一些代码示例,人们可以很容易地看到您所做的或未做的对/错。您的文字仍然不够清楚。如果您的目的只是打开一个新的
子窗口
,则您可以键入或者请详细说明。@ErhanYaşar我已经编辑了我的问题(很抱歉我的英语不好)