var DemoApp = angular.module('DemoApp', ['dx']);
DemoApp.controller('DemoController', function DemoController($scope) {
$scope.startValue = 10;
$scope.endValue = 90;
$scope.numberBox = {
startValue: {
min: 0,
max: 100,
showSpinButtons: true,
bindingOptions: {
value: "startValue"
}
},
endValue: {
min: 0,
max: 100,
showSpinButtons: true,
bindingOptions: {
value: "endValue"
}
}
};
$scope.rangeSlider = {
simple: {
min: 0,
max: 100,
start: 20,
end: 60
},
withLabel: {
min: 0,
max: 100,
start: 35,
end: 65,
label: {
visible: true,
format: function(value) {
return value + "%";
},
position: "top"
}
},
withTooltip: {
min: 0,
max: 100,
start: 15,
end: 65,
tooltip: {
enabled: true,
format: function (value) {
return value + "%";
},
showMode: "always",
position: "bottom"
}
},
withHideRange: {
min: 0,
max: 100,
start: 20,
end: 80,
showRange: false
},
withStep: {
min: 0,
max: 100,
start: 20,
end: 70,
step: 10,
tooltip: {
enabled: true
}
},
disabled: {
min: 0,
max: 100,
start: 25,
end: 75,
disabled: true
},
handler: {
min: 0,
max: 100,
bindingOptions: {
start: "startValue",
end: "endValue"
}
}
};
});
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>DevExtreme Demo</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script>
<link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/20.2.6/css/dx.common.css" />
<link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/20.2.6/css/dx.light.css" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js"></script>
<script>window.angular || document.write(decodeURIComponent('%3Cscript src="js/angular.min.js"%3E%3C/script%3E'))</script>
<script src="https://cdn3.devexpress.com/jslib/20.2.6/js/dx.all.js"></script>
<link rel="stylesheet" type="text/css" href="styles.css" />
<script src="index.js"></script>
</head>
<body class="dx-viewport">
<div class="demo-container" ng-app="DemoApp" ng-controller="DemoController">
<div class="form">
<div class="dx-fieldset">
<div class="dx-field">
<div class="dx-field-label">Default mode</div>
<div class="dx-field-value">
<div dx-range-slider="rangeSlider.simple"></div>
</div>
</div>
<div class="dx-field custom-height-slider">
<div class="dx-field-label">With labels</div>
<div class="dx-field-value">
<div dx-range-slider="rangeSlider.withLabel"></div>
</div>
</div>
<div class="dx-field custom-height-slider">
<div class="dx-field-label">With tooltips</div>
<div class="dx-field-value">
<div dx-range-slider="rangeSlider.withTooltip">
</div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Without range highlighting</div>
<div class="dx-field-value">
<div dx-range-slider="rangeSlider.withHideRange">
</div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">With discrete step</div>
<div class="dx-field-value">
<div dx-range-slider="rangeSlider.withStep"></div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Disabled</div>
<div class="dx-field-value">
<div dx-range-slider="rangeSlider.disabled"></div>
</div>
</div>
</div>
<div class="dx-fieldset">
<div class="dx-fieldset-header">Event Handling and API</div>
<div class="dx-field">
<div dx-range-slider="rangeSlider.handler"></div>
</div>
<div class="dx-field">
<div class="dx-field-label">Start value</div>
<div class="dx-field-value">
<div dx-number-box="numberBox.startValue"></div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">End value</div>
<div class="dx-field-value">
<div dx-number-box="numberBox.endValue"></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
.custom-height-slider {
height: 75px;
}
.dx-field > .dx-rangeslider {
flex: 1;
}