I can't fetch data on ionic app page by HTTP API. data only showing in console but not showing in ionic app page on display. please help me to find out the error

I am having some problem on ionic. I am not able to display data on screen via http in ionic.
i only showing data on google console.

this is the code of the file.

home.page.html (home page code)*

users{{users}}

<ion-item *ngIf=“users”>
username{{users}}


home.page.ts (ts file code)*

import { Component } from ‘@angular/core’;
import { NavController } from ‘@ionic/angular’;
import { HttpClientModule } from ‘@angular/common/http’;
import { HttpClient } from ‘@angular/common/http’;

@Component({
selector: ‘app-home’,
templateUrl: ‘home.page.html’,
styleUrls: [‘home.page.scss’],
})
export class HomePage {

users: any=;

constructor(
public navctrl: NavController,
public httpclient: HttpClient,
public httpclientmodule: HttpClientModule
) {
this.getdata();
}
getdata() {
this.httpclient
.get(‘https://jsonplaceholder.typicode.com/users’)
.subscribe(
(data) => {
console.log(data);
this.users = [data];
},
(error) => {
console.log(error);
}
);
}
}

Output screen

It looks like you’re not iterating through the data. Try something like this in your html.

<ion-list  *ngIf=“users”>
    <ion-item *ngFor="#item of users">
        Username: {{item.username}}
    </ion-item>
</ion-list>

1 Like

i already do this in my code but never working.