I have a common controller that I need access in multiple ng-app scope
Ex:
Controller
function commonCtrl($scope){
$scope.data = { message: "Hello World" };
}
First ng-app
<div ng-app="firstApp">
<div ng-controller="commonCtrl">
<h1>{{data.message}}</h1>
</div>
</div>
Second ng-app
<div ng-app="secondApp">
<div ng-controller="commonCtrl">
<h1>{{data.message}}</h1>
</div>
</div>
This is not working. I can set scope to one ng-app like
angular.module('firstApp', [])
But How can I make controller as common controller for all ng-app?