I have implemented a slider using ion-range-slider. It is having a disable option to make the slider enable or disable. But I need to make it enable/disable dynamically.
I tried this way. I am not able to achieve this. Please help me what I need to do? Her's the code.
<ion-range-slider #advancedSliderElement
type="single"
[min]="0"
max="100"
from={{r.rule}}
from_shadow="true"
to="40"
to_shadow="true"
grid="true"
grid_num="10"
prefix=""
postfix=""
decorate_both="false"
disable = "rangeDisable"
(onChange)="update(advancedSlider, $event)"
(onFinish)="finish(advancedSlider, $event, i)">
</ion-range-slider>
My manage.ts code is:
export class ManagePage {
public rangeDisable: boolean = true;
constructor(public navCtrl: NavController) {}
enableSave() {
this.rangeDisable = false;
}
}
I need to make slider enable on click of a button
<button class="button-border" ion-button round (click)="enableSave()" ><i class="material-icons">create</i> </button>
Please guide me how to proceed.
You just need to use
[]
to bind your boolean variable to the property of the component.