I was trying to use keyvalue pairs with ion-select-option.
In my .ts file I have a map<string, any>
categoryMap: Map<string, any> = new Map();
ngOnInit() {
this.categoryMap["boys"] = ["Shorts", "Boxers", "Shirts", "T-shirts"];
this.categoryMap["girls"] = ["Salwar", "Ghagra Choli", "Frocks"];
console.log(this.categoryMap);
}
In my app.component.html I am doing this
<ion-select placeholder="Category">
<ion-select-option [value]="c.key"
*ngFor="let c of categoryMap | keyvalue" >
{{ c.key }}</ion-select-option>
</ion-select>
But I don’t see any options in the list.
Could someone guide me here if I am doing something wrong?
1 post - 1 participant