Yokesh Varadhan
Yokesh Varadhan

Reputation: 1636

Set range knob to min and max end

i have a ion-range button I have set it to min and max value in dual knob but both the knob are located to the min value

   <ion-range dualKnobs="true"  [(ngModel)]="knobValues"  pin="true" min="50" max="250" color="dark" >
      <ion-label range-left > <b>50</b> </ion-label>
      <ion-label range-right > <b>250</b> </ion-label>
    </ion-range>

set this after my constructor(){}

 knobValues:{
  upper:100,
  lower:50
}  

Currently i an getting like this

enter image description here

I need it to be like this on page load

enter image description here

Could someone help me

Upvotes: 0

Views: 670

Answers (1)

Suraj Rao
Suraj Rao

Reputation: 29635

In typescript, the way to set class variable is

 variable_name:type = value;

 knobValues:{
  upper:100,
  lower:50
} 

Above you have set the type of knobValues and its content is undefined.

Set as

 knobValues:{ upper:number,lower:number}={
      upper:100,
      lower:50
    }

Upvotes: 1

Related Questions