-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?

3
  • 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. Commented Mar 16, 2017 at 18:09
  • there was no point to downvote. Commented Mar 16, 2017 at 18:09
  • Possible duplicate of Angularjs does not load scripts Commented Mar 16, 2017 at 21:20

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.