I know this question has been asked before, but please read this completely before you FLAG me... I have tried what the other posts have said, but I cannot stop the error.
Question: I am getting this cursed error,
"Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays."
and I don't understand what I am doing wrong, so WHAT AM I DOING WRONG?
Explanation: I am reaching out to saleforce to retrieve an array of over 1400+ responses. I have been working with Angular long enough to know how to put the code together, but don't fully understand it. This is the same approach I am using for other request I have sent to salesforce.
My Attempts: So the first SO post I read (Angular: Cannot find a differ supporting object '[object Object]') spoke about the format of the array. The array is coming back in the same format as others (which have no error), and I have tried to even format the response into .json() to be sure. The second post (Cannot find a differ supporting object '[object Object]') said something about using similar names, but I don't believe that applies to me.. and regardless they didn't solve my issue.
THE CODE:
This reaches out the a service that reaches to the salesforce API
getProviders(){ this.reqObj.email = this.cus.getCurrentUser(); this.dss.allProviders(this.reqObj).subscribe(res => { this.serviceProvider = res console.log("All Providers", res); }) } //End getProviders
How I link to the API
allProviders(reqObj): Observable<Object>{ return this.http.get("https://xxxxxx.execute-api.us-east- .amazonaws.com/prod").map(res => res); }
iteration in the HTML
<div class="table-row n-txt" *ngFor="let sList of serviceProvider; let i=index" (click)="openProviderAction(sList)"> <div class="table-cell c1">{{sList.Name}}</div> <div class="table-cell c2" > -- -- </div> <div class="table-cell c2" > {{sList.county__c}} </div> <div class="table-cell c3" > {{sList.Phone}}</div> <div class="table-cell c4" >
Is it possible that the size of the array is causing the error???