Reputation: 1636
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
I need it to be like this on page load
Could someone help me
Upvotes: 0
Views: 670
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