【发布时间】:2018-12-03 15:35:38
【问题描述】:
我正在尝试在我的 Angular 应用程序中嵌入托管 HTML 页面。然而,div 又回到了空白。我按照这篇文章修改了angular 7的代码,无济于事Angular4 Load external html page in a div
我在控制台注销结果,但显示为空
我的代码如下
template: any = '';
constructor(http: HttpClient) {
http.get('http://www.google.com').map((html: any) => this.template = html);
console.log(this.template);
}
<div [innerHtml]="template"></div>
【问题讨论】:
标签: angular