Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/384.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript AngularJS$http参数_Javascript_Php_Angularjs_Web Services_Hybrid Mobile App - Fatal编程技术网

Javascript AngularJS$http参数

Javascript AngularJS$http参数,javascript,php,angularjs,web-services,hybrid-mobile-app,Javascript,Php,Angularjs,Web Services,Hybrid Mobile App,我正在尝试将angularJS应用程序连接到我创建的web服务。web服务有一个switch语句,它根据传递的参数选择正确的php文件。在本例中,我希望将操作、检索传递给web服务。如何使我的$http.get通过将由switch语句读取的参数 调用Web服务 function customersController($scope,$http) { $http.get("http://10.137.98.144") .success(function(response) {$scope.

我正在尝试将angularJS应用程序连接到我创建的web服务。web服务有一个switch语句,它根据传递的参数选择正确的php文件。在本例中,我希望将操作、检索传递给web服务。如何使我的$http.get通过将由switch语句读取的参数

调用Web服务

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;
            }

您可以通过url传递参数

试试这个:

$http.get("http://10.137.98.144?action=retrieve")
在php中,可以将参数与

$param = $_GET('action');