php - 从 PHP MySql 访问 $http.post 请求中的 JSON 数据
问题描述
有没有办法在函数内部从 $http.post PHP mysql 访问 json 数据,如下所示:
$scope.getAllNamesList = function() {
$http.post("database/selectall_names.php", {user_id: $scope.selectedUserID})
.then(function(response){
$scope.names = response.data;
if(response.data.user_city == "xxx")
{
$scope.selectedCity = response.data.user_city;
}
});
}
解决方案
推荐阅读
- ffmpeg - 在ffmpeg中覆盖带有多个文本的字幕
- php - Paypal Orders API 混合单一&订阅购买
- php - NGINX - 从上游读取时拒绝重命名权限
- python - Windows 10 IIS 服务器上的 Python Flask 托管
- r - R如何在新列中获得afinn分数
- java - 将每个字符转换为另一个一致的字符
- angular - Angular cdkOverlay 禁用关闭
- javascript - Java 脚本验证问题
- javascript - 如果 API 有参数和标头,Service Worker 将缓存 WEBAPI 数据(等待 cache.addAll(API_URLS))
- javascript - 使用 Java 脚本 (JS) 从文本 (txt) 文件中提取特定值