Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Passing object with ion-segment

$
0
0

@ghostrunners wrote:

I'm trying to pass an entire object when an ion-segment-button is selected. But the [attr.] isn't a known property of ion-segment. I find that I can do it so by using the json pipe on the object via value, but I'd rather use value for a string field that is mapped to the ngModel instead.

<ion-segment [(ngModel)]="something" (ngModelChange)="onChange($event)">
  <ion-segment-button *ngFor="let some of things" value="{{some | json}}" [attr.data-thing]="{{some}}">
    {{some.label}}
  </ion-segment-button>
</ion-segment>

So I really like the look and feel of the ion-segments, whereas I could have just went with trying to group a bunch of buttons. Any ideas if this is possible?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



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