JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app ng-controller="TestParseController">
<div id="innerh"></div>
</div>
JavaScript
var TestParseController = function($scope, $window, $http, $sce,
$compile) {
$scope.hide = function(obj) {
alert("ciao");
};
$scope.to_trusted1 = function(html_code) {
html_code = $sce.trustAsHtml(html_code);
$scope.content = html_code;
//alert(html_code);
document.getElementById('innerh').innerHTML = html_code;
$compile( document.getElementById('innerh'))($scope);
};
$scope.html_content = "<button data-ng-click='hide($event)'>Click me!</button>";
$scope.to_trusted1($scope.html_content);
}