Skip to content
This repository was archived by the owner on Oct 5, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ But, if the `tooltip` attribute is in conflict with another angular directive, y
<!-- it can be used as an element -->
<slider ng-model="sliders.sliderValue" min="testOptions.min" step="testOptions.step" max="testOptions.max" value="testOptions.value" slider-tooltip="hide"></slider>
```

#### Event Calbacks
```html
<!-- event callbacks receive the name of the event and the associated value with that event -->
<slider ng-model="sliders.sliderValue" onSlideStop="myCallback($event,value)"></slider>
```
4 changes: 2 additions & 2 deletions slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ angular.module('ui.bootstrap-slider', [])
slideStop: 'onStopSlide'
};
angular.forEach(sliderEvents, function (sliderEventAttr, sliderEvent) {
var fn = $parse(attrs[sliderEventAttr]);
var fn = $parse(attrs[sliderEventAttr.toLowerCase()]);
slider.on(sliderEvent, function (ev) {
if ($scope[sliderEventAttr]) {
$scope.$apply(function () {
fn($scope.$parent, { $event: ev, value: ev });
fn($scope.$parent, { $event: sliderEvent, value: ev });
});
}
});
Expand Down