Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49082

Keyvalue pipe with ion-select

$
0
0

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

Read full topic


Viewing all articles
Browse latest Browse all 49082

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>