Yamen Imad Nassif Yamen Imad Nassif - 1 year ago 79
AngularJS Question

JS file is loaded but not being executed

I have a project running on

angular js
and its all working good except for a strange thing.

I added a
file to execute some
functions i already tested in the browser console and they are all working good with no errors the problem is when I inspect element i can see the file being called in the head and i can also see it in the sources I can even open the link and see the file.
But for some reason the functions in there are not being called executed.

following the images to prove that its loading with no errors.

Its not about putting the code in ready function or not

file accessed from browser

in head

in sources

no errors

Answer Source

$(document).ready is firing before angular has loaded the content onto the page.

So it might be the possibility of your jQuery plugin calls before your Angular loads the content onto the page.

what you need to do is somehow, call your jQuery plugin once your Angular gets init or you can turns your code into directive.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download