我有三个角度服务呼叫,其中应该对第一个服务呼叫的值的结果进行服务呼叫2和3。但我的代码根本没有打第二次服务电话。请在下面找到代码段。
datacontext.GetUnitRegistration(serialNumber, customerId).then(function (response) { //1st service call
vm.SerialNumber = serialNumber;
vm.UnitRegistration = response;
vm.errorMsg = config.constantValues.NoRecordsFoundMsg;
document.getElementById('hdnHasClaims').value = vm.UnitRegistration.UnitWarranty.isEligWarr;
if (vm.UnitRegistration.UnitWarranty.isEligWarr == true) {
datacontext.GetUnitComfortPlanClaimList(serialNumber).then(function (result) {//2ndst service call
if (result.Success == false) {
vm.exceptionMsg = vm.exceptionMsg + result.responseText;
vm.HasException = true;
vm.HasComfortPlanClaimsResults = false;
}
else {
if (result.length == 0) {
vm.HasComfortPlanClaimsResults = false;
}
else {
vm.HasComfortPlanClaimsResults = true;
}
$scope.ComfortPlanGrid.data = result;
}
spinner.spinnerHide();
$scope.$apply();
}).fail(function (error) {
spinner.spinnerHide();
});
datacontext.GetUnitStandardClaimList(serialNumber).then(function (result) { //3rd service call
if (result.Success == false) {
vm.exceptionMsg = vm.exceptionMsg + result.responseText;
vm.HasException = true;
vm.HasUnitStandardClaimList = false;
}
else {
if (result.length == 0) {
vm.HasUnitStandardClaimList = false;
}
由于 维杰