Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

How do i get access to the ng-click function (updateRating) in the below?

https://jsfiddle.net/by2jax5v/171/

I'm using $sce.trustAsHtml to render $scope.content

$scope.bindHTML = $sce.trustAsHtml($scope.content);
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

Your above code does get compiled but it is sanitized by angular js considering an anchor tag as insecure, therefore ng-click does not work.

what you want to achieve can be achieved by using ng-html-compile by francis bouvier instead of ng-bind-html. It the thinnest library i have seen just 1kb. https://github.com/francisbouvier/ng_html_compile

also refer to https://stackoverflow.com/a/41790235


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...