angular-selectize icon indicating copy to clipboard operation
angular-selectize copied to clipboard

$scope does not seem to $digest when you first select an option from the dropdown

Open xeroxoid opened this issue 10 years ago • 1 comments

It looks that in 3.0.1 something is broken. When you select an item for the first time from the dropdown, the $scope does not get digested, so any bindings will obviously not update. I do not seem to be able to reproduce it on a plunkr but since I updated it broke at certain places where for example I have

<selectize blah ng-model="thecontroller.themodel"></selectize>

{{thecontroller.themodel}}

the value in the curly ones will not update on the first selection but rather on any consecutive ones..

If I manually call $scope.$digest for example on the onChange callback it works...

xeroxoid avatar Oct 13 '15 15:10 xeroxoid

Tried with $scope.$apply but I keep having $digest already in progress error. I finally chose to use $timeout which allow to avoid this error and works fine for me. See angular's doc.

moussa-b avatar Oct 03 '17 14:10 moussa-b