My service to enter has:
enter (date: any): Observable {
console.log (data.email, data.senha);
(& # 39; $ {this.baseUrl} / `+ & # 39 ;? email = & # 39; +` $ {date.email} `+ & # 39; & password = & # 39; +` $ { date.senha} `);
}
And my "login" component the input button has:
()
this.jogadorService.entrar (this.user)
.subscribe (() => {
this.jogadorService.entrar (this.user);
alert (& # 39; Login made & # 39;);
//this.router.navigate (['/login'])
});
}
But he accepts any data. I wanted to check if the username and password exist and are the same. And if the empty JSON comes back {}
Then show the message.
How can I do?
Taking advantage of the enthusiasm, if the result is correct, store the result in the LocalStorage.