-2

Want to submit form dynamically though scope variable.But it is not working. Even, simple example as below that alert is also not executing.

$scope.sctext = $sce.trustAsHtml('<div>text<script type="javascript">alert('working'); other scripts</script></div>');

Html:

  <div>{{sctext}}</div>

Is it possible to execute javascript & html like above?

dsi
  • 3,199
  • 12
  • 59
  • 102
  • Its for - payment gateway integration where dynaimically created form which is going to submit through script only. so, wanted to pass that script to html. finally solve by - directive - link - element.append which place that script and solved. – dsi Mar 16 '17 at 18:09
  • there was no point to downvote. – dsi Mar 16 '17 at 18:09
  • Possible duplicate of [Angularjs does not load scripts](http://stackoverflow.com/questions/18220197/angularjs-does-not-load-scripts-within-ng-view) – georgeawg Mar 16 '17 at 21:20

1 Answers1

0

Have solved by - directive - link (element) { element.append(script) }

dsi
  • 3,199
  • 12
  • 59
  • 102