danielcrisp / angular-rangeslider

Simple directive that creates a range slider for Angular, styled to match Bootstrap-styled form elements
danielcrisp.github.io/angular-rangeslider/
MIT License
223 stars 122 forks source link

under ng-if #99

Open khsmaxim opened 8 years ago

khsmaxim commented 8 years ago

Under ng-if vertical orientation works wrong attrs.$observe('orientation', ... pos = 'top'; posOpp = 'bottom'; values still "left" and "right"

faster way to solve it - put watchers under timeout

 $timeout(function() {
     // listen for changes to values
     scope.$watch('min', setMinMax);
     scope.$watch('max', setMinMax);
     scope.$watch(function () {
        return modelMin();
     }, setModelMinMax);
     scope.$watch(function () {
        return modelMax();
     }, setModelMinMax);
 }, 0);