AngularJS 中未定义 memberID

memberID not defined in AngularJS

我正在尝试更新特定用户的详细信息,但它一直给我错误消息,即脚本中未定义 memberID。我应该写什么?已经尝试过 memb,但仍然给了我同样的错误。感谢帮助

Members.controller('editMembers',['$scope','$http','$routeParams',function($scope, $http,$routeParams){
    var id=$routeParams.id;
    console.log(id);
    $scope.updateMember="";

    //populating data with exsisting member details
    $http.post('PHP/getMemberByID.php',{'id':id}).success(function(data){
        $scope.memb=data;
        console.log(data);
    });

    $scope.updateMember = function(project) {
        $http.post('PHP/editMembers.php/'+id, memberID).success(function(data) {
            if (data) {//row updated
              console.log("Succesful Update");
            } else {
              console.log("Unsuccesful Update");
            }
        });
    };
}]);

在函数中传递 memberID 代替项目

$scope.updateMember = function(memberID) {
    $http.post('PHP/editMembers.php/'+id, memberID).success(function(data) {
        if (data) {//row updated
            console.log("Succesful Update");
        }
        else {
            console.log("Unsuccesful Update");
        }
    });
};

或者如果 memberID 在项目集合中,则点赞

$scope.updateMember = function(project) {
    $http.post('PHP/editMembers.php/'+id, project.memberID).success(function(data) {
        if (data) {//row updated
            console.log("Succesful Update");
        }
        else {
            console.log("Unsuccesful Update");
        }
    });
};