将angular变量转换为php


angular variable to php

我无法让它工作。有人能帮我吗?我想在点击链接后显示用户的详细信息,但我不知道如何通过链接将信息发送到php文件。

我有详细的用户信息链接,如:

<tr ng-repeat="user in users | filter:searchText | orderBy:'finish_date'">
          <td><a href="#/user/{{user.user_id}}">{{user.name + ' ' + user.lastname}}</a></td>
          <td> {{user.begin_date}}</td>
          <td> {{user.finish_date}}</td>
</tr>

和控制器:

gymiControllers.controller('UserDetailCtrl', ['$scope', '$http',  function ($scope, $http) {
      console.log($scope.user.user_id);
      $http.get('php/UserDetailsGetData.php?user_id=user.user_id"').success(function(data) {
        $scope.user = data;
      });
    }]);

和php文件,应该从angular中获取变量;-):

$user_id = $_GET['user_id'];

将其更正为:

gymiControllers.controller('UserDetailCtrl', ['$scope', '$http',  function ($scope, $http) {
      console.log($scope.user.user_id);
      $http.get('php/UserDetailsGetData.php?user_id='+$scope.user.user_id).success(function(data) {
        $scope.user = data;
      });
    }]);