Why doesn't AngularJS work with multiple grace scripts?

At the bottom of my HTML is the following:

<script defer="defer" src="http://localhost:8080/bower_components/jquery/dist/jquery.min.js"></script>
<script defer="defer" src="http://localhost:8080/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script defer="defer" src="http://localhost:8080/apps/promotion/active.js">
    // "Gulped" angular, ngAnimate, ui.bootstrap, and my angular app; in that order.
</script>
</body>
</html>

In random moments, I will get this error while refreshing the page:

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.4.9/$injector/modulerr?p0=activePromos&p1=Err…20(http%3A%2F%2Flocalhost%3A8080%2Fapps%2Fpromotion%2Factive.js%3A1%3A7124)

Sometimes this happens for several updates per line, and sometimes it will work for several updates per line. However, there are times when I get an error and it is annoying.

I found the following: If I delete the scripts jqueryand bootstrap, so that I only have one script(active.js) with the attribute defer, it always works. I am trying to load scripts after loading a page in the specified order.

- (requirejs?)? , defer , , AngularJS. JS , 1 2 CSS.

+4
1

angular , JavaScript.

, , , , AngularJS bootstrap .

+4

Source: https://habr.com/ru/post/1626883/


All Articles