Receiving this error in console:
Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
services.ts
private url = "https://api.iextrading.com/1.0/stock/market/batch?symbols=SNAP,fb,AIG%2b,GOOG,AAPL,AMZN&types=quote";
constructor(private http: HttpClient) {}
getCID(): Observable<any> {
return this.http.get<any>(this.url);
}
component.ts
ngOnInit() {
this.svc.getCID().subscribe(data => {
this.cidData = data;
console.log(data);
});
component.html
<div *ngIf="cidData">
<ul>
<li *ngFor="let x of cidData">
<a routerLink="/companydetails/{{x.symbol}}">{{x.symbol}}</a>
API call gives
{"GOOG":{"quote":{"symbol":"GOOG","companyName":"Alphabet Inc."}}, "SNAP":{etc...}
I think the issue is that cidData is not an array, but I'm not really sure how to return it as an array