Angular 4 - 从字符串变量保存模板渲染模板

Vin*_*nni 3 rendering typescript angular

如何使用字符串变量(保持模板)呈现 html - Angular4。

样本.component.ts

let stringTemplate = "<div><p>I should be rendered as a HTML<br></p></div>";
Run Code Online (Sandbox Code Playgroud)

sample.component.html应该基于变量stringTemplate 中的元素呈现

注意:stringTemplate不是静态的。将从服务器获取其数据。