0
I have a variable called "link_youtube", which contains a data similar to this:
<iframe width="640" height="360" src="https://www.youtube.com/embed/eNs5g-c1Qno?list=RDeNs5g-c1Qno" frameborder="0" allowfullscreen></iframe>
however the browser does not identify it as an html, it identifies it as a string, need my system to identify it as an HTML, someone could help me?
follows below the html code:
insira o código aqui
<div class="text-center">
<h1>{{sPCrtl.campanha.titulo}}</h1>
{{sPCrtl.campanha.biografia_campanha.link_youtube}}">
</div>
Hello Giovane, I tried to use the command as follows <div [innerHtml]= "<iframe width="560" height="315" src="https://www.youtube.com/embeddAY9dh-HWo" frameborder="0" allowfullscreen></iframe>" - it did not work :/
– Matheus Freitas
tried to use, this.iframe = "<iframe width="560" height="315" src="https://www.youtube.com/embed/2dAY9dh-HWo" frameborder="0" allowfullscreen></iframe>" HTML: <div [innerHtml] = "{{Ctrl.iframe}}" = also did not work.
– Matheus Freitas
Should I import some dependency ?
– Matheus Freitas
@Matheusfreitas updated the answer, really I had not tested with iframe and I passed the answer because I had already injected html this way before. You’ll have a little more work to deal with iframe.
– Giovane