id
をパラメータとして渡す単純なeditCategory()
関数を持っていますが、PHPコードのid
を取得する正しい方法は何か分かりません。そこに変数AngularJsを使ってPHPに渡すパラメータを取得する
$scope.EditCategory = function(id) {
$http.get('details.php', {'id': id})
.success(function(data, status, headers, config) {
ngDialog.open({
template: "details.html"
});
}).error(function(data, status) {
$scope.msg = 'Some error';
$scope.msg_type = 'error';
});
};
とPHPで私はあなたはとても価値がGETになります$http.get
を使用している$id = the id that I passed with Angular
私はあなたが$ http.post not.getをしたいかもしれないと思いますか? PHPの最後で$ _postを拾うか、file_get_contents( ') – Doug
する必要があるかもしれません。このようにしてjson_decode(file_get_contents(' php:// input ')、true)["id"] – user1915308