当前位置:   jquery > 正文

函数中的$ http.get方法

javascript,angularjs,json,go,DevBox,在线流程图,编程,编程问答,程序员,开发者工具,开发工具,json解析,二维码生成,unix时间戳,在线开发工具,前端开发工具,开发人员工具,站长工具



1> Dan..:

你可以使用$ q的'all'功能:

    var a = $http.get(DataElementUrl).then(function (response) {
        if (!response.data == "")
        dataElementJson = response.data;

    });
    var b = $http.get(categoryComboUrl).then(function (response) {
            if (!response.data == "")
                categoryComboJson = response.data;                   
    });
    var c = $http.get(categoryUrl).then(function (response) {
                if (!response.data == "")
                   categoryJson = response.data;                        
    });

    $q.all([a, b,c]).then(function(result) {
      check++;
      $scope.getJson();
    });

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/blog/jquery/detail/13650
推荐阅读
相关标签
  

闽ICP备14008679号