Using the " – Aniket Oct 11 '18 at 11:40

1

According to this answer you might want to try to use defer instead of async, which leads to the browser to respect the loading order. E.g.:

<script src="scripts/vendor-including-angular.js" defer></script>    
<script src="scripts/your-app.js" defer></script>
Community
  • 1
  • 1
hugo der hungrige
  • 12,382
  • 9
  • 57
  • 84
0

You may want to merge all dependent JS files into one before using async. Use Grunt, Gulp, Broccoli or another task runner for this.

If the script is modular and does not rely on any scripts then use async.

Source: Frontend performance tips for web developers.

mab
  • 2,658
  • 26
  • 36
0

DON'T USE async attribute with Angular.js script tag.

It seems that using async attribute is harmful. Without it, expressions are evaluated on DOMContentLoaded event, but with the async attribute, there are evaluated on window load event, that is much later. Tested for Angular.js 1.0 and 1.4 in latest version of Firefox, Chrome and IE11.

Leos Ondra
  • 1,575
  • 3
  • 11
  • 16