I am attempting to showcase an array as options in a dropdown menu, but I keep encountering the following error:
ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
The HTML code I am using is:
<mat-option *ngFor="let type of exportTemplates" value="{{ type.id }}">
{{ type.label }}
</mat-option>
Here is how the array looks: https://i.sstatic.net/yg7Q1.png
This is my TypeScript code:
exportTemplates = [];
const subs = this.configService.state$.subscribe((config: any) => {
this.exportTemplates = config.templates.types;
});
this.subscription.push(subs);