I am trying to insert an entire iframe and output it to the html. The reason why it has to be an iframe is because I have a function that handles several video embeds like youtube, vine and more - and they all have different tags.
So what I'd like to do is the following:
Input:
var html = '<iframe src="//www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allowfullscreen></iframe>';
$scope.video_element = $sce.trustAsHtml(html);
and on the controller:
<div ng-bind-html="video_element"></div>
I'd like the iframe to be outputted as a whole inside of the div. Many times, it just outputs a n '[object HTMLIFrameElement]' not the actual iframe. Can anyone guide me in the right direction please? A plunkr would be awesome.
Thanks.