I think it's simple, but going from Ionic 1 to 3, changed so many things.
I need to get all the returns from my Json from this routine (I actually need the user ID and register in localstorage):
submit(){
var email = this.data.email;
var senha = this.data.senha;
var link = 'http://localhost/webapi/consultarEmailSenha.php?email='+email+'&senha='+senha;
//var myData = JSON.stringify({email: this.data.email}) + JSON.stringify({senha: this.data.senha});
console.log(link);
this.http.get(link)
.subscribe(data => {
this.data.response = data["_body"]; //https://stackoverflow.com/questions/39574305/property-body-does-not-exist-on-type-response
console.log(this.data.response[0]);
console.log(this.data.response[1]);
console.log(this.data.response[2]);
console.log(this.data.response[3]);
console.log(this.data.response[3]);
}, error => {
console.log("Oooops!");
});
The return of Json looks like this:
[{"idusuarios":"1","nome":"Ramos J","email":"[email protected]","celular":null,"telefone":"","data_nascimento":"1978-07-19","altura":null,"peso":null,"gordura":null,"vo2":null,"senha":"teste"}]