1
In the system I’m developing, there will be a field input
for the user to search if such CPF already exists registered in the Database, if you have I want to show all the data of this client in an already filled form
This is the function that searches 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"
});
}
And what’s the problem? What are you getting? How does what you get diverges from the expected?
– Vinícius Gobbo A. de Oliveira
I get the data from the client of such searched Cpf, for example, </br> ZIP: "0000000" CITY: "xxxxx" </br> COMPLEMENT: "xxxxxx" </br> CPF: "123.456.789-99" </br> DTNASCIMENTO: "xxx" </br> ID_CLIENTE: "1" </br> NAME: "xxxxxx" </br> NOME_MAE: "xxxxxxxx" </br> NOME_PAI: "xxxxxx" <br/> and this data I want to show in an html form
– Luiz Fábio
From what I have seen you are returning a string, all separated by <br/>, it would be interesting if you returned a JSON from the server, so you could bind with the ng-model and display each information in an input field. if there is no possibility you could play this string on a field a property and bind with a text field.
– Renan Degrandi