2

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.

Community
  • 1
  • 1
Aameer
  • 1,366
  • 1
  • 11
  • 30
  • I have the same problem. I'm also new to angularjs and I not sure where to search for the solution or what to start with. It might be it just do not work that way. – Pidhorskyi Oct 06 '15 at 17:49

0 Answers0