html5boilerplate - AngularJS in HEAD vs BODY -


In all AngularJS examples, the angular library is placed in the head tag of the document. I have an existing project that was built on the HTML5 boilerplate layout. It defines that JS libraries are very low under the DOM & lt; / Body & gt; must be placed before the tag.

Should AngularJS be kept in HEAD?

Angulios do not have to be placed in the head, and in reality you should not normally do it , Because this block will be loading HTML

However, when you load AngularJS at the bottom of the page, you will need to avoid or use "Flash of Unrelated Content". Note that you only need to use ng-clock / ng-bind on your "index.html" page. When using ng-added or ng-view or other angular structure to draw additional material after the initial page load, that material will be compiled by the cooner before it is displayed.

See also

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -