M
M
MadmaN132016-05-24 16:08:34
JavaScript
MadmaN13, 2016-05-24 16:08:34

How to stop execution of a connected script in Angular?

I connect the script to one of the states (ui-router) via "script src=", but after I change the state the script continues to work in the background. How can I stop script execution?
PS: I tried to destroy the element on $on('$destroy'), but it didn't help..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2016-05-24
@healqq

Most likely the script hangs some events on document/window. Disable them in scope.destroy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question