Made a data binding, and the value on the page does not change. Although the variable is changing.
TS:
export class SliderRangeComponent { range: string = "25 - 55"; onRangeChange(model: string): void { console.log("range " + this.range); this.range = model; console.log(model); } createSliderRange(minValue: number, maxValue: number) { var scope = this; $("#slider-range").slider({ animate: "fast", range: true, min: minValue, max: maxValue, values: [ minValue, maxValue ], slide: function (event, ui) { let newVal: string = `${ui.values[0]} - ${ui.values[1]}`; //$("#range").val(newVal); scope.onRangeChange(newVal); } }); } } HTML:
<p> <label for="range">Years range: </label> <input type="text" id="range" value="{{ range }}" [ngModel]="range" />{{ range }} </p> <div id="slider-range"></div> If you remove from the comments is $("#range").val(newVal); then the value changes. But as I understood it should change when the variable variable changes
createSliderRangecalled? - Grundy