I am new to angularjs,so I am assuming there is something simple which I am missing about this. I am facing an issue where my back-end sends some html which includes a script tag which has some js example is as under.
<!--some html-->
<script>
//some js code
caption_class_fn = function(){
$('.jwcaptions').addClass('%s')//%s as its added from backend
}
caption_class_fn()
</script>
This html is then filled into $scope.htmlval
which is bound with an html element like this ng-bind-html="htmlval".
The issue I am facing is that I want to execute a js function which is present in side the script tags. I tried alert, console.log but nothing seems to work. Although once the page is loaded if I try the same fucntion from console it works.Any idea how can i achieve this with minimum code change. I also tried to this solution here but this also isn't working for me.