In the system that I'm developing, it will have a input
field for the user to search if such a CPF already exists registered in the Database, if I have I want to show all the data of that client in an already completed form
This is the function that does the search in the database and returns the query
$scope.PesquisarCpf = function () {
$http.post("http://GetCpf.php", {'cpf':$scope.cliente.cpf,}).
success(function(data, status, headers, config){
$scope.contratos = data;
}).error(function(data, status, headers, config){
location.href="#/Cliente"
});
}