【发布时间】:2014-11-24 13:04:37
【问题描述】:
我正在尝试将我的 angularJS 应用程序连接到我创建的 Web 服务。 Web 服务有一个 switch 语句,它根据您传递的参数选择正确的 php 文件。在这种情况下,我希望通过操作,检索到 Web 服务。如何让我的 $http.get 传递将由我的 switch 语句读取的参数
调用网络服务
function customersController($scope,$http) {
$http.get("http://10.137.98.144")
.success(function(response) {$scope.names = response;});
}
网络服务
switch ($_POST['action'])
{
case 'retrieve':
require "retrieve.php";
retrieve();
break;
}
【问题讨论】:
标签: javascript php angularjs web-services hybrid-mobile-app