vaishu ani
vaishu ani

Reputation: 117

Ionic range slider does not work

I am using ionic 3.

Here is my code

<ion-range  dualKnobs="true"  min="$10" max="$100" color="secondary" >
              <ion-label range-left>$10</ion-label>
              <ion-label range-right>$100</ion-label>
 </ion-range>

But range slider does not work.

Kindly advice me,

Thanks

Upvotes: 1

Views: 1565

Answers (1)

Swapnil Patwa
Swapnil Patwa

Reputation: 4099

With dual knob slider you need to set an object as default value.

This should work-

HTML:

<ion-range  dualKnobs="true"  min="$10" max="$100" [(ngModel)]="rangeObject"  color="secondary" >
              <ion-label range-left>$10</ion-label>
              <ion-label range-right>$100</ion-label>
</ion-range> 

TS:

public rangeObject:any= {lower: 0, upper: 100};

Upvotes: 6

Related Questions