Ich versuche, zu abonnieren, um mein Knoten Server reslut und ich versuchte folgende meine ts,Wie Antwort des Knotens Server
.subscribe(
response => {
if (response.json().result == 'success') {
this.toastr.success('Loggedin successfully');
this.router.navigate(['/demo/profile']);
}
else {
this.toastr.error('Email or Password is wrong');
}
});
meine Server-Antwort,
{
"status": "success",
"result": [
{
"profile_id": 1,
"firstname": "Sachin",
"repeatpassword": null,
"type": null,
"connection_status": null,
"relation_id": null
}
]
}
kann jemand helfen abonnieren
mich
Was ist dein Problem? Irgendwelche Fehler usw.? In Ihrem 'if' suchen Sie nach 'response.json(). Result', aber in Ihrem JSON enthält das' status'-Feld den Wert ... – rinukkusu
Ich habe mich wie oben beschrieben für meinen Erfolgsfall angemeldet – MMR
'response.json(). status == 'success'' – micronyks