Trying to use ng-bind-html to insert iframe into page with AngularJS & I can't get it to work it on even the simplest form.
Javascript
function Ctrl($scope) {
$scope.showIt = '<iframe src="http://www.anything.com"></iframe>';
}
My HTML:
<div ng-bind-html="showIt"></div>
You need to use $sce service to tell angular to render html content on view
Angular Doc says
Before doing it, you need to inject
ngSanitizedependency inside your appYou can do it in two way either using
filterorcontrollerHTML
JavaScript Code
From angular 1.2 onwards $sce feature is enabled for below version you should enable/disable it in config phase of angular.
Here is Working Fiddle