如何从Angular1中高效获取城市数据字典?
- 内容介绍
- 文章标签
- 相关推荐
本文共计177个文字,预计阅读时间需要1分钟。
gistfile1.txt/portal/dictSelect.action?cateEname=ctyfatherValue=0$rootScope.dictTxtFun=function(cateEname,firstVal,secondVal,thirdVal){var firstValue=;var dictTxt=;if(secondVal!='' && secondVal!=null && secondVal!=undefined){f
/portal/dictSelect.action?cateEname=cty&fatherValue=0 $rootScope.dictTxtFun = function(cateEname,firstVal,secondVal,thirdVal){ var firstValue = "0"; var dictTxt = ""; if(secondVal!='' && secondVal != null && secondVal != undefined){ firstValue = firstVal; } dictService.loadDict(cateEname,firstValue) .then(function(res) { for (var i = 0; i < res.length; i++) { if (firstVal == res[i].id) { dictTxt = res[i].text; } } }).then(function(res){ if(secondVal!='' && secondVal != null && secondVal != undefined){ dictService.loadDict(cateEname,firstValue,secondVal) .then(function(res) { for (var i = 0; i < res.data.length; i++) { if (secondVal == res.data[i].id) { dictTxt = dictTxt + res.data[i].text; } } }) } }).then(function(res){ if(thirdVal!='' && thirdVal != null && thirdVal != undefined){ dictService.loadDict(cateEname,secondVal,thirdVal) .then(function(res) { for (var i = 0; i < res.data.length; i++) { if (thirdVal == res.data[i].id) { dictTxt = dictTxt + res.data[i].text; } } }) } }) return dictTxt; }
本文共计177个文字,预计阅读时间需要1分钟。
gistfile1.txt/portal/dictSelect.action?cateEname=ctyfatherValue=0$rootScope.dictTxtFun=function(cateEname,firstVal,secondVal,thirdVal){var firstValue=;var dictTxt=;if(secondVal!='' && secondVal!=null && secondVal!=undefined){f
/portal/dictSelect.action?cateEname=cty&fatherValue=0 $rootScope.dictTxtFun = function(cateEname,firstVal,secondVal,thirdVal){ var firstValue = "0"; var dictTxt = ""; if(secondVal!='' && secondVal != null && secondVal != undefined){ firstValue = firstVal; } dictService.loadDict(cateEname,firstValue) .then(function(res) { for (var i = 0; i < res.length; i++) { if (firstVal == res[i].id) { dictTxt = res[i].text; } } }).then(function(res){ if(secondVal!='' && secondVal != null && secondVal != undefined){ dictService.loadDict(cateEname,firstValue,secondVal) .then(function(res) { for (var i = 0; i < res.data.length; i++) { if (secondVal == res.data[i].id) { dictTxt = dictTxt + res.data[i].text; } } }) } }).then(function(res){ if(thirdVal!='' && thirdVal != null && thirdVal != undefined){ dictService.loadDict(cateEname,secondVal,thirdVal) .then(function(res) { for (var i = 0; i < res.data.length; i++) { if (thirdVal == res.data[i].id) { dictTxt = dictTxt + res.data[i].text; } } }) } }) return dictTxt; }

