Yamen Imad Nassif Yamen Imad Nassif - 2 months ago 6
AngularJS Question

JS file is loaded but not being executed

I have a project running on

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

I added a
JavaScript
file to execute some
JQuery
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.

Edit:
Its not about putting the code in ready function or not

file accessed from browser

in head

in sources

no errors

Answer

$(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.