const DemoApp = angular.module('DemoApp', ['dx']);
DemoApp.controller('DemoController', ($scope) => {
$scope.value = 10;
$scope.numberBoxOptions = {
min: 0,
max: 100,
showSpinButtons: true,
bindingOptions: {
value: 'value',
},
};
$scope.slider = {
simple: {
min: 0,
max: 100,
value: 90,
},
withLabel: {
min: 0,
max: 100,
value: 50,
label: {
visible: true,
format(value) {
return `${value}%`;
},
position: 'top',
},
},
withTooltip: {
min: 0,
max: 100,
value: 35,
rtlEnabled: false,
tooltip: {
enabled: true,
format(value) {
return `${value}%`;
},
showMode: 'always',
position: 'bottom',
},
},
withHideRange: {
min: 0,
max: 100,
value: 20,
showRange: false,
},
withStep: {
min: 0,
max: 100,
value: 10,
step: 10,
tooltip: {
enabled: true,
},
},
disabled: {
min: 0,
max: 100,
value: 50,
disabled: true,
},
onHandleMoveOptions: {
min: 0,
max: 100,
bindingOptions: {
value: 'value',
},
},
onHandleReleaseOptions: {
min: 0,
max: 100,
valueChangeMode: 'onHandleRelease',
bindingOptions: {
value: 'value',
},
},
};
});
<!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/22.2.6/css/dx.light.css" />
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/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/22.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-slider="slider.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-slider="slider.withLabel"></div>
</div>
</div>
<div class="dx-field custom-height-slider">
<div class="dx-field-label">With tooltip</div>
<div class="dx-field-value">
<div dx-slider="slider.withTooltip"></div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Without range highlighting</div>
<div class="dx-field-value">
<div dx-slider="slider.withHideRange"></div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">With discrete step</div>
<div class="dx-field-value">
<div dx-slider="slider.withStep"></div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Disabled</div>
<div class="dx-field-value">
<div dx-slider="slider.disabled"></div>
</div>
</div>
</div>
<div class="dx-fieldset">
<div class="dx-fieldset-header">Process Value Changes</div>
<div class="dx-field">
<div class="dx-field-label">On handle movement</div>
<div class="dx-field-value">
<div dx-slider="slider.onHandleMoveOptions"></div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">On handle release</div>
<div class="dx-field-value">
<div dx-slider="slider.onHandleReleaseOptions"></div>
</div>
</div>
<div class="dx-field">
<div class="dx-field-label">Slider value</div>
<div class="dx-field-value">
<div dx-number-box="numberBoxOptions"></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
.custom-height-slider {
height: 75px;
}
.dx-field .dx-slider {
flex: 1;
}