my solution is adding a property to component class and call it : "iterablePlainMap" .
add to your .ts :
plainMap = new Map<String, boolean>();
iterablePlainMap;
deleteEntry(key: string) {
this.plainMap.delete(key);
this.updateIterablePlainMap();
}
setEntry(key: string, value: boolean) {
this.plainMap.set(key, value);
this.updateIterablePlainMap();
}
updateIterablePlainMap() {
this.iterablePlainMap = [];
this.plainMap.forEach((value, key) => {
this.iterablePlainMap.push({ value, key });
});
}
actualy setEntry and deleteEntry methods are wraping original set and delete methods of plainMap
and in your .html :
<div *ngFor="let item of iterablePlainMap;let index = index;trackBy:trackByIndex;">
<input [(ngModel)]="iterablePlainMap[index].value" type="checkbox">
</div>