When working with values retrieved from an API in JSON format, I encounter a challenge.
While I can view the object's values in the console, I struggle to assign them to individual variables.
Is there a way to separate and assign these values to different variables?
I aim to validate the data before passing it to the HTML for display.
this.http
.get(this.url + e)
.map((res) => res.json())
.subscribe((data) => this.user = data);
OR
getData() {
let e = md5(this.userString);
this.http
.get(this.url + e)
.map((res) => res.json())
.subscribe(
user => this.user = user,
error => this.errorMessage = <any>)}
Thank You