Currently, I am working with Ionic 3, which utilizes Angular and TypeScript.
My goal is to use ngFor with a Map type in my project.
Below is what I have implemented so far:
interface IShared_Position {
lat: number;
lng: number;
time: number;
color?: string;
}
public shared_position = new Map<string, IShared_Position>();
Here is the HTML code related to this:
<ion-list>
<ion-item ion-item *ngFor="let item of shared_position">
<h2>{{ item.time }}</h2>
</ion-item>
However, I encountered the following error message:
Error: Cannot find a differ supporting object '[object Map]' of type 'object'. NgFor only supports binding to Iterables such as Arrays.
Is there a way to bind my map even if it's not iterable?
How should I proceed in this situation?