Placement of the ng-app directive (html vs body)
There is no big difference where you put ng-app
.
If you put it on <body>
then you have a smaller scope for AngularJS which is slightly faster.
But I have used ng-app
on the <html>
for manipulating the <title>
.
I was on a team working on a legacy app and found it best to use the ng-app tag in a div that is used as a wrapper to isolate new code from the legacy code.
We discovered this while working on the app that was heavily relying on jqGrid and Dojo.
When we added ng-app to the head tag it blew up the site, but when we used a wrapper we could use Angular with no problems.