darul75 / angular-awesome-slider

:arrows_clockwise: Angular slider control directive
http://darul75.github.io/angular-awesome-slider/
MIT License
143 stars 63 forks source link

Reinitialize slider with diff set of options #120

Closed venkata82 closed 8 years ago

venkata82 commented 8 years ago

I have an angular app. I'm using slider for music app. when a song changes, I like to reinitialize slider. But, does not find an option.

darul75 commented 8 years ago

are you changing options attribute dynamically ?

by default options are watched based on angular equals() function

https://github.com/darul75/angular-awesome-slider/blob/master/src/core/index.js#L141 https://docs.angularjs.org/api/ng/function/angular.equals

or try to change your option to

watchOptions: false

venkata82 commented 8 years ago

Yes. I change attributes dynamically. 

Sent from Yahoo Mail on Android

From:"Julien Valéry" notifications@github.com Date:Wed, Jul 22, 2015 at 3:58 PM Subject:Re: [angular-awesome-slider] Reinitialize slider with diff set of options (#120)

are you changing options attribute dynamically ?

— Reply to this email directly or view it on GitHub.

darul75 commented 8 years ago

made some tests with small changes and slider rebuild automatically.

      scope.changeOptions = function() {

        scope.options.from = 20;
        scope.options.to = 50;
...

   }

any code to share with me

venkata82 commented 8 years ago

The problem is actually with the Angular Scope. I integrated awesome slider as a HTML5 Audio control skin. I lost $scope digestion on HTML5 Audio control events. I had to apply scope manually to fix issue. Thanks for your quick response. Appreciated!

darul75 commented 8 years ago

Good news scope sharing is quite difficult sometimes in angular. But I will check my mobile events again and refactore when got time :)