This repository has been archived by the owner on Oct 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
/
test.js
67 lines (60 loc) · 1.89 KB
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
angular.module('angular-bootstrap-slider-test', ['ui.bootstrap-slider'])
.controller('TestCtrl', ['$scope', '$log', function ($scope, $log) {
$scope.testOptions = {
min: 5,
max: 100,
step: 5,
precision: 2,
orientation: 'horizontal', // vertical
handle: 'round', //'square', 'triangle' or 'custom'
tooltip: 'show', //'hide','always'
tooltipseparator: ':',
tooltipsplit: false,
enabled: true,
naturalarrowkeys: false,
range: false,
ngDisabled: false,
reversed: false
};
$scope.range = true;
$scope.model = {
first: 0,
second: [],
third: 0,
fourth: 0,
fifth: 0,
sixth: 0,
seventh: 0,
eighth: 0,
ninth: 0,
tenth: 0
};
$scope.value = {
first: $scope.testOptions.min + $scope.testOptions.step,
second: [$scope.testOptions.min + $scope.testOptions.step, $scope.testOptions.max - $scope.testOptions.step],
third: 0,
fourth: 0,
fifth: 0,
sixth: 0,
seventh: 0,
eighth: 0,
ninth: 0,
tenth: 0
};
$scope.prefix = 'Current value: ';
$scope.suffix = '%';
$scope.formatterFn = function (value) {
return $scope.prefix + value + $scope.suffix;
};
$scope.delegateEvent = null;
$scope.slideDelegate = function (value, event) {
if (angular.isObject(event)) {
$log.log('Slide delegate value on ' + event.type + ': ' + value);
}
else {
$log.log('Slide delegate value: ' + event);
}
$scope.delegateEvent = event;
};
}]
);