Aniruddha Das Aniruddha Das - 10 months ago 96
AngularJS Question

ng-click is removed by ngsanitize

I am getting setting some html text in my

variable which also contains
attribute so that it on click of a link it will call angular controller function.

$scope.message = "dum messge<a data-ng-click='loadCalenderData()'>retry</a>";

<div ng-bind-html="message"></div>

I tried both
but no luck.

Answer Source

Because it's not $compiled. When you bind-html, that doesn't tell Angular to search through that HTML and compile directives within it. You'll need a custom directive for this.

Check this link