Working with two modules in AngularJS
问题 I have two modules with different operations and I tried to work with them as shown below. <div id="viewBodyDiv" ng-app="xhr"> <div ng-controller="xhrCtrl"> <button ng-click="callAction()">Click</button> {{sample}} </div> </div> <div id="viewBodyDiv2" ng-app="xhr2"> <div ng-controller="xhr2Ctrl"> <button ng-click="alertMessage()">Click</button> </div> </div> The JS is shown below. angular.module('xhr', []).controller('xhrCtrl', function ($http, $scope, $window) { $scope.sample = "sadf";