In terms of performance best practice it is recommended to load the javascripts at the bottom of the page. AngularJS official documentation also states the same for angular applications.
Place the script tag at the bottom of the page. Placing script tags at the end of the page improves app load time because the HTML loading is not blocked by loading of the angular.js script.
My web page is full of angular directives and angular bindings and i dont have any static html content inside my body tag. Does the general recommendation still applicable for my site? I hope that this recommendation only applicable to the sites with static content and partial angularJS content.
If i put my angular at the bottom, i assume that first my html will be loaded and then angular parsing and then again html loading, parsing and script execution will happen. Is it true? If i place my angular at the top of the page, can i get some performance benefit or performance will be worsen?
I have combined and minified all my scripts into one. I dont have any external templates. I have inline templates with some data biding. Also you can assume that i use ng-cloak and debugInfoEnabled false.
My app looks like
<!DOCTYPE html>
<html ng-app="coreModule">
<head>
<title>Angular App</title>
<link rel="stylesheet" type="text/css" href="app.css">
</head>
<body>
<directive1></directive1>
<directive2></directive2>
..
<directive10000></directive10000>
<script type="text/javascript" src="angular.js"></script>
<script type="text/javascript" src="app.js"></script>
</body>
</html>
instead do i need to use in the below way?
<!DOCTYPE html>
<html ng-app="coreModule">
<head>
<title>Angular App</title>
<link rel="stylesheet" type="text/css" href="app.css">
<script type="text/javascript" src="angular.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body>
<directive1></directive1>
<directive2></directive2>
..
<directive10000></directive10000>
</body>
</html>