Good Morning
I have a variable (data.response) in my code that stores the return of a query in the database.
Now I want to use this variable in other classes to do other database queries from that class.
Can someone help me?
submit() {
let toast = this.toastCtrl.create({ duration: 3000, position: ‘bottom’ });
var link = ‘my_link_api’;
var data = JSON.stringify({username: this.username,
senha: this.senha});
this.http.post(link, data)
.subscribe(data => {
this.data.response = data._body;
if(this.data.response === 'Você não tem login')
{
toast.setMessage('O e-mail ou a senha digitada não é valido.');
}
else
{
this.navCtrl.push(HomePage);
}
}, error => {
console.log("Oooops!");
});
toast.present();
}