Ion-range default value

Hi all, I want to set a default value for the ion-range, however, I can’t find it in the manual : http://ionicframework.com/docs/v2/api/components/range/Range/

And I have tried to achieve it as below, but it won’t work.

<ion-range min="1" max="3" snaps="true" value="2"> <ion-label range-left class="small-text">A</ion-label> <ion-label range-right>A</ion-label> </ion-range>

May I know how can set it? Many thanks.

You can set default value using ngModel.

html

  <ion-range min="1" max="3" [(ngModel)]="saturation" secondary>
    <ion-label range-left class="small-text">A</ion-label>
    <ion-label range-right>A</ion-label>
  </ion-range>

ts

 private saturation = 2;

regards.

3 Likes

check this post:

2 Likes