user2249972
user2249972

Reputation: 7895

How to remove <script> from HTML in angular dynamically

I am trying to integrate my application with third party payment. They provided the JS file which I am including in my HTML.

var script = document.createElement("script");
    script.src = "URL"
    document.body.appendChild(script); 

I wanted to remove existing file and add same JS file again every time whenever user choose to perform some particular action.

How can I achieve this?

Upvotes: 0

Views: 69

Answers (0)

Related Questions