I am currently working on an Ionic Project. Upon button click, a request is processed and data is received as shown below:
public login() {
//this.showLoading()
var test33;
this.auth.login(this.registerCredentials).subscribe(data => {
console.log(data["_body"])
test33 = data["_body"]
console.log(test33)
},
error => {
this.showError(error);
});
}
Within the view:
<ion-row class="logo-row">
<ion-col></ion-col>
<h2 *ngFor="let user0 of test33">{{ user0.name }}</h2>
<ion-col width-67>
<img src="http://placehold.it/300x200"/>
</ion-col>
<ion-col></ion-col>
</ion-row>`
Upon checking the console, I see that the data is being stored in variable test33 as:
[{"id":1,"role_id":1,"name":"Dr. Admin","email":"<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d0b1b4bdb9be90b1b4bdb9befeb3bfbd">[email protected]</a>","avatar":"\/user\/1\/profile\/HR1-dummy-avater.png","password":"$2y$10$iEpnh6pJ09rxH5NFFCVzaewBCxC\/FHZuHnkWA6qUrOBO3tYIBbsVC","remember_token":"VgwXUdIpL6EqW7Fp66VGRPjSKE727Inc4MTseJQq84cTCglkS335KCqVnavu","created_at":"2017-05-25 22:46:10","updated_at":"2017-06-14 05:19:52","is_feature":null}]
However, {{user0.name}}
does not return the name.
Please assist in identifying where my mistake lies.