I have a div and I have to add some html code that is in variable to that using Angular2.
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>";
}
I have to add str string as html in div named myDiv.