I'm just starting with Angular 4 and I'm attempting to retrieve a JSON value using http.post
.
The response I'm receiving is: {"status":"SUCCESS"}
component
onSubmit(value: any) {
console.log("POST");
let url = `${this.posts_Url}`;
this.http.post(url, value)
.subscribe(resBody => {
this.model.authstatus = resBody.json();
console.log("Values====="+this.model.authstatus);
});
}
Currently, when I try to assign the value, it ends up displaying as Values====={"status":"Failure"}
Is there a way for me to set the value like
this.model.authstatus = 'Failure'