I am trying to bind Data which is coming from API, Data is showing in the network but When I am trying to bind data it is giving me an error -
Cannot find a differ supporting object
function'. NgFor only supports binding to Iterables such as Arrays.
API Data in Network
[{deliveryid: 0, frequency: "", ContactName: "Aa", Email: "[email protected]",…},…]
//While expanding the response
{deliveryid: 0, frequency: "", ContactName: "Aa", Email: "[email protected]"}
.TS
public MyDigestEmailIdPrint = [];
DigestEmailIdPrint() {
var postData = {
clientid: localStorage.getItem("storageselectedclient"),
};
this.article.DigestEmailIdPrint(postData).subscribe(
(res) => {
if (res.message != "No Record Found") {
this.MyDigestEmailIdPrint.push(res);
}
},
(err) => {
console.log(err);
}
);
}
.HTML
<tbody>
<tr *ngFor="let details of MyDigestEmailIdPrint">
<td> {{details.ContactName}}</td>
<td> {{details.Email}}</td>
<td> {{details.frequency}}</td>
<td><input type="checkbox"></td>
</tr>
</tbody>
ngForfor an object which, as the error states, is not an iterable. Your backend is not giving you an array, but an object.