I'm getting error while retrieving data from the database.
Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
I tried all the remaining responses but I'm not getting the exact solution.
my service.ts:
users: User[];
getAllUsers(){
return this.http.get(environment.apiBaseUrl + '/users');
}
my component.ts:
refreshUserList(){
this.userService.getAllUsers().subscribe((res) => {
this.userService.users = res as User[];
})
};
my component.html:
<tr *ngFor="let use of userService.users">
<td>{{ use.fullName }}</td>
</tr>