I render a button saved from SQL Server database. View source for the button looks like the following -
<button id="btn" class="mainBtn" ng-click="OpenBtn('btn')" >Do something</button>
This button is part of a MainDiv which looks like following -
<div id="MainDIV" ng-bind-html="MainDIVHTML">
I assign MainDIVHTML value as follows -
$scope.MainDIVHTML= $sce.trustAsHtml(entity.MainDIVHTML);
Where entity.MainDIVHTML is the saved HTML from database.
mainBtn is inside the entity.MainDIVHTML
The saved HTML and the page where I am using saved HTML share the Angular.js controller.
I am not able to execute - ng-click="OpenBtn('btn')" event.
The markup (HTML) is shown correctly though.