$scope.renderHtml = function (htmlCode) { return $sce.trustAsHtml(htmlCode); };
$scope.testText = "hello";
$scope.testing = '<h1>{{testText}}</h1>';
...
<div ng-bind-html="renderHtml(testing)"></div>
The result of this is "{{testText}}" rather than "hello". So it seems it is not possible to render html code that uses the content of a scope variable. Is this correct or am I doing something wrong? Is there another way to achieve the same (render html AFTER angularjs has loaded and that html uses a the content of a scope variable)?