How to get data in php passed by parameter with angle

2

I need to get 1 last data from the angle controller for my php file, how do I?

app.controller("EditarPerfilCtrl", function ($scope, $http, $window) {

var idempresa = $window.localStorage.getItem('idemp');
var empresa = $window.localStorage.getItem('empresa');
var usuario = $window.localStorage.getItem('usuario');
var idusuario = $window.localStorage.getItem('idusuario');

$scope.empresa = empresa;
$scope.usuario = usuario;

var params = {
    idusuario: idusuario
}

var buscaUsuario = function(){
        $http.get("http://localhost:8888/sistemas/webApps/fluxo_de_caixa/fluxojoin_2.0/php/buscaUsuario.php", params).then(function(data){
        console.log(data);
    });
}

buscaUsuario();

});

php:

<?php
ini_set('display_errors', true);
error_reporting(E_ALL);

include_once("con.php");

$pdo = conectar();

$params = $_GET['params'];
print_r($params);
?>
    
asked by anonymous 11.01.2017 / 22:04

1 answer

1

First, you have to pass the parameters, right?!

Where you have params you have to say what you want to go through. Even if you created a variable with the data, params is still an attribute of

11.01.2017 / 22:59