I've been trying to display data from a web api but i got an error when iterating to display them.
Here's is a copy of my component file.
this.uploadService.getFiles()
.subscribe(
data => this.files$ = data
);
HTML COMPONENT FILE:
<a *ngFor="let file of files$" class="list-group-item list-
group-item-action">{{file.id}}</a>`
THE WEBAPI JSON FILE:
[{"Id":458,"FileCode":609"},{"Id":451,"FileCode":602"}]
THE SERVICE FILE:
public getFiles(){
return this.httpClient.get(this.SERVER_URLGETFILE)
}
The error message i got is "Cannot find a differ supporting object []NgFor only supports binding to Iterables such as Arrays."