无法从函数中获取值

tkclm6bt  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(192)

如下所示,我将值传递给函数,但无法从中获得任何值作为回报。我需要vm.phonenumberstatus中的值,试图从phone_状态变量获取值
这是我使用的html

<span ng-if="vm.phoneNumberStatus.VerificationStatus=='Valid'"> {{vm.phoneNumberStatus.VerificationStatus}} </span>  

vm.verifyNumber(vm.phoneNumberStatus, vm.CandidateInfo1[0].Phone_Mobile, vm.currentMPhoneStatus)

vm.verifyNumber = function (phone_status, number, currentStatus) {
    return factory.getTableObj('PhoneVerificationDetails', {
        PartitionKey: api.Emp_Id
    })
    .then(function (vfdata) {
        phone_status = vfdata.find(function (s) {
            vm.trimmedNumber = number.replace(/[- )(]/g, '')
            return s.To === vm.trimmedNumber
        });
        currentStatus = phone_status.VerificationStatus;
        if (phone_status.VerificationStatus == 'Pending') {
            vm.startVerifyNumber = $interval(function () {
                $interval.cancel(vm.startVerifyNumber)
                vm.verifyNumber(phone_status, number, currentStatus)
            }, 5000)
        }
        if (phone_status.VerificationStatus != 'Pending') {
            $interval.cancel(vm.startVerifyNumber)
        }
    })
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题