I am working on a project based on Angular 2. I got stuck in one problem. I am dealing with Iframe. In my angular component, I am generating an Iframe as:
this.ifrm = document.createElement("iframe");
console.log(title_colorr);
this.ifrm.setAttribute("src", "http://web.com/newsfeed/");
this.ifrm.style.width = widthh + "px";;
this.ifrm.style.height = heightt + "px";
I am getting a full Iframe code when I am putting
console.log(this.ifrm);
as:
<iframe src="http://web.com/newsfeed/" style="width: 250px; height: 250px;"></iframe>
Now the problem is when I am trying to use this in my HTML template as:
<p >{{ifrm}}</p>
then I am getting :
[object HTMLIFrameElement]
I have used <p [innerHTML]="ifrm"></p>
too, but no solution is there.
Is there anybody, who knows how to solve this?