Webサービスを2回呼び出すと、2つの異なるセクションのグリッドが同じページに表示されます。Webサービスが返されるまでAngular JSで待機する方法
そして、両方のWebサービスコールが返されるまでページを表示したくありません。唯一私がset the please wait off
と表示したいグリッド移入の両方の後
if (params) {
//I set the please wait dialog on
$scope.pleaseWait = { "display": "block" };
//I hit the first service call and it will populate myFirstUIGrid
TransactionApiServices.getApiUnmergeProcessDetails(params).then(function (results) {
$scope.gridOptions_PR.data = "";
$scope.gridOptions_PR.data.length = 0;
$scope.gridOptions_PR.data = results.data;
console.log(results);
});
//I hit the second service call and it will populate mySecondUIGrid
TransactionApiServices.getApiUnmergeRequestDetails(params).then(function (results) {
$scope.gridOptions_RQ.data = "";
$scope.gridOptions_RQ.data.length = 0;
$scope.gridOptions_RQ.data = results.data;
console.log(results);
});
............ ABCCtrl.jsに
:ここ
は、それがどのように見えるかですグリッド。
<div class="home-grid-content" ng-controller="TransactionDetailsUnmergeController">
<div ng-style="pleaseWait">
<div class="refresh" style="width:100%;height:100px;">
<h4>Please wait....</h4>
</div>
</div>
<div ng-style="toggleDetails">
<h3>Unmerge Request Log</h3>
<div ui-grid="gridOptions_RQ" ui-grid-selection class="" ui-grid-pagination ui-grid-auto-resize>
<div class="watermark" ng-show="!gridOptions.data.length">No data available</div>
</div>
<div class="grid-pager">
<uib-pagination boundary-links="true" total-items="totalItems" items-per-page="4" ng-change="pageChanged(currentPage)" ng-show="(totalItems>4) == true"
ng-model="currentPage" class="pagination" direction-links="false" id="HconstUnmerge_1"
first-text="«" last-text="»">
</uib-pagination>
</div>
<br/>
<h3>Unmerge Process Log</h3>
<div ui-grid="gridOptions_PR" ui-grid-selection class="" ui-grid-pagination ui-grid-auto-resize>
<div class="watermark" ng-show="!gridOptions.data.length">No data available</div>
</div>
<div class="grid-pager">
<uib-pagination boundary-links="true" total-items="totalItems" items-per-page="4" ng-change="pageChanged(currentPage)" ng-show="(totalItems>4) == true"
ng-model="currentPage" class="pagination" direction-links="false" id="HconstUnmerge_1"
first-text="«" last-text="»">
</uib-pagination>
</div>
<div style="margin-top:8px;">
<button type="button" class="btn btn-default pull-left" ng-click="backToDetailsPage()">Cancel</button>
</div>
</div>
</div>
使用根本Q –