I have 5 widgets on my dashboard and I am making a separate call to get the data for each of those widgets.
I have a structure like below :
<div>
<div id="widget1">
--Widget 1 data
</div>
<div id="widget2">
--Widget 2 data
</div>
<div id="widget3">
--Widget 3 data
</div>
<div id="widget4">
--Widget 4 data
</div>
<div id="widget5">
--Widget 5 data
</div>
</div>
On the angular front, I have scope variables for each of the widget which is updated based on API start and end:
$scope.dataLoadedForWidget1 = true;
$scope.dataLoadedForWidget2 = true;
$scope.dataLoadedForWidget3 = true;
$scope.dataLoadedForWidget4 = true;
$scope.dataLoadedForWidget5 = true;
$scope.showEntireDiv = true;
I have a directive that works on the True/False value to grey out the entire div.
<div isloaded="showEntireDiv">
But my question is since I have individual API, where do I set the value of $scope.showEntireDiv ?
How do I make sure to set the value of $scope.showEntireDiv only after the API call is complete?
Updated:
$scope.getEmployees = function () { //callback function 1
myService.getEmployeeData().success(function (data) {
$scope.employees= data.response;
}).finally(function () {
});
};