I have seen many people ask this question, however the answers are so complicated that they do not make sense, neither do the fiddles. I am having an issue with ngSanitize removing my ng-click links on elements. Some say there must be a $compile directive to get this fixed but I do not understand how it works.
I have not tried the $compile option because the baseline examples provided on the internet do not fit what I am trying to do. I simply need ng-bind-html to retain my ng-click functions.
This PHP creates the links given back to the Angular App through $http.
while ($row = mysqli_fetch_array($result)) {
$response = $response."<br>".$row[2]."<br><a class='btn btn-primary text-white' data-ng-click='injectSample(".$row[0].", ".$category.")'>Select</a><hr>";
}
This is the function that will test out my parameters.
$scope.injectSample = function(id, cat) {
console.log("test");
console.log("Injecting Sample "+id+" from category "+cat+".");
}
This is the HTML where the ng-bind-html exists
<div class="modal-body" ng-bind-html="samples">
</div>
Right now the "Select" link is created and the button shows, but ng-click is removed by ngSanitize.