Having utilized trustAsHtml and ng-bind-html extensively, I am quite familiar with their usage.
Lately, I have been attempting to include some ng-event in my HTML code that was requested through HTTP and displayed using ng-bind-html.
However, the issue is that the event is not triggering. Here is a snippet of the code:
$http({
method: "POST", url: 'target url',
data: {tardata: data},
header: {'Content-Type': 'application/x-www-form-urlencoded'}
}).success(function (data) {
$scope.mydata = data;
});
Afterwards, I am modifying some values in mydata using a text replace function:
txt = txt.replace(key[a], '<b ng-mouseover="displayDefin(\'value\')" >'+value+'</b>');
Although I used ng-mouseover, it did not trigger. Upon inspecting the page source code, I confirmed that the content was updated with the ng-mouseover event.
I am unsure if this is possible or not. If not, and if you are aware of an alternative method in AngularJS, please advise me.