<分区>
我有一个 div,我必须使用 Angular2 添加一些可变的 html 代码。
import {Component,Input,ViewChild,ElementRef,OnInit} from 'angular2/core';
@Component({
selector: 'my-view',
template: `
<div #myDiv>{{str}}</div>
`,
styleUrls:['src/css/thedata.css']
})
export class AngularComponent{
private str = "<div class='EachWidget FL'><div class='WidgetDataParent'><div class='widgetTitleBar'></div></div></div>";
}
我必须在名为 myDiv 的 div 中添加 str 字符串作为 html。