i want to fetch data from the 2 controllers. im getting data from one controller but im not getting data from the other controller.how to call the two controllers in one function
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http) {
$http.get("url")
.then(function(response) {
$scope.pir_data= response.data;
$pir_Status_bit_= response.data.pir_staus;
app.controller('watertankCtrl', function($scope, $http) {
$http.get("url")
.then(function(response) {
$scope.watertank_data = response.data;
$scope.wt_level = response.data.dataFrame;
});
});
html
<div class="col-lg-4" ng-app="myApp" ng-controller="myCtrl">
<div class="our-team-main">
<div class="team-front">
<h4>Door Monitoring</h4>
<a>PIR Smart Security</a>
<hr />
<p align="left">
Door Status- {{pir_Status_bit}} <br />
</p>
</div>
</div>
</div>
<div class="col-lg-4" ng-app="myApp" ng-controller="watertankCtrl">
<p align="left">
Level - {{wt_level}} v<br />
</p>
</div>
</div>
</div>