angularjs - 如何在 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
}
解决方案
推荐阅读
- angular - 使用角度路由器无法显示页面顶部
- java - 了解 HotSpot 中的通知方法
- go - 在 go 中将切片长度与 uint32 进行比较的最佳方法(用于对抗性上下文)
- php - 使用 WP_Query 呈现分页的问题
- python - 方法和函数有什么区别?(请非常基本的解释)
- kubernetes - 为什么在 kubctl get pods 中仍然显示已完成状态的 pod?
- node.js - node.js - 调用外部 API 并将它的响应保存到 mongoDB
- python - 要列出的整数
- c# - 在 WebApi2 中创建过滤器以过滤图像
- preact - 处理按键总是少一个键作为 event.target.value