@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