Is it bad practice to declare both ng-app
and ng-controller
on the tag?
For example:
I don't think there will be any problem so far. The only impact is the rootscope no more readable from html markup, because the controller scope is overriding it.
For example,
<div id="parent" ng-app>
<div id="child" ng-controller='...'>
$rootScope.$id = 002 // rootscope from $rootscope service
$("#parent").scope().$id =002 // rootscope scope get from element scope
$("#child").scope().$id =003 // controller scope get from element scope
when it comes to the same markup,
<div id="parent" ng-app ng-controller='...'>
$rootScope.$id = 002 // rootscope from $rootscope service
$("#parent").scope().$id =003 // controller scope get from element scope
Here you have no way to get rootscope from element scope, but who cares.
You should be able to access and set the title via the $window
abstraction, thus removing the need to put a controller on the html
tag.