首页 > 解决方案 > 如何在 AngularJs 中获取返回值?

问题描述

我正在尝试获取返回值“dataJson”,但我没有完全定义。

谁能告诉我我该怎么做才能得到它?

非常感谢!

    $scope.sendRequest = function (port) {
        var dataJson;
        $http({
           method: "GET",
           url: CCHK3AnalysisWebserviceUrl + `/Get` + port + `ForPC?PageSize=10000&PageCount=1&ConditionJson=` + CondtJson,
          }).then(function (data) {
                dataJson = $scope.parseData(data.data);
          }, function (err) {
                console.log(err)
          })
            return dataJson
         }

标签: angularjspromise

解决方案


推荐阅读