How can I use ng-click in ng-bind-html

I am using ng-bind-html in my controller, for example

$scope.message='  You  currently have no ORDERS <a href= "javascript:void(0)" ng-click="Back()">Back13</a>';

and on the html page

<strong ng-bind-html="message">Warning!</strong>

But Back () does not work, even I tried compiling $ as a similar question . Can anyone solve this problem?

+4
source share
1 answer

try it

$scope.message='  You  currently have no ORDERS <a **href="javascript:;"** ng-click="Back()">Back13</a>';

Change href="javascript:void(0)"tohref="javascript:;"

and also see below discussion

ng-click do not work when the linked template uses ng-bind-html-unsafe

AngularJS: ng-bind-html does not work with button tag

-1
source

All Articles