There is this SO question that seems to imply it is possible to use controllers from different modules by defining tag attributes like:
<div ng-controller="submodule1.controller1">{{ whatever1 }}</div>
<div ng-controller="submodule2.controller2">{{ whatever2 }}</div>
and by bootstrapping angular with a module that contains both submodule1
and submodule2
as dependencies.
I've been trying to do so without success. Can anyone confirm this is not possible or provide a pointer to a working example of this construction?
I am talking explicitly about ng-controller
tag attributes and not about having controllers interact programmatically with each other.
I am also explicitly referring to manual angular.bootstrap(document, ['myApp'])
of the page, because I am using require.js to load all JS files and therefore I cannot use the ng-app
attribute.
I am using angular 1.3.18.