Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Is a $apply missing? #61

Open
vrracing opened this issue Aug 18, 2014 · 3 comments
Open

Is a $apply missing? #61

vrracing opened this issue Aug 18, 2014 · 3 comments
Milestone

Comments

@vrracing
Copy link

Running the provided example.html completely unaltered...

angular-slider

The single slider is being declared as...

<slider //configRemovedForClarity// ng-model='value' style="width: {{ sliderWidth }};">
Value:

and $scope.value is defined in the controller like...

$scope.value = 5;

However, the controller's 'value' isnt getting updated. In Models for (003) you can see that 'value' is 9. But in the slider on the left, you can see I dragged the slider to 6 and if we were to look inside Scope (004) value would be equal to 6 matching what's in the DOM.

If I run a $scope.$apply(), the bindings will get sync'd and the controller's 'value' will change to 6.

Thanks,

Jim

@vrracing
Copy link
Author

Quick follow on, adding an ng-mouseup to the sliders calling an empty function is enough to make everything work without having to touch the directive's source.

@drgould drgould added this to the v1.0 milestone Sep 4, 2014
@drgould
Copy link
Contributor

drgould commented Sep 4, 2014

I'm in the process of rewriting the slider from scratch. I'll keep an eye out for this.

@vrracing
Copy link
Author

vrracing commented Sep 4, 2014

It's a nice piece. Thanks for sharing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants