Skip to content

Commit

Permalink
Merge pull request #213 from liorch88/evalAsync
Browse files Browse the repository at this point in the history
Use evalAsync instead of timeout on init to fix #189
  • Loading branch information
leocaseiro authored Aug 29, 2016
2 parents 8b7e137 + f6a07c9 commit 2bfc8da
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/angular-chosen.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
}
return element.trigger('chosen:updated');
} else {
$timeout(function() {
scope.$evalAsync(function() {
chosen = element.chosen(options).data('chosen');
});
if (angular.isObject(chosen)) {
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-chosen.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/chosen.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ angular.module('localytics.directives').directive 'chosen', ['$timeout', ($timeo
return
return element.trigger('chosen:updated')
else
$timeout ->
scope.$evalAsync ->
chosen = element.chosen(options).data('chosen')
return
if angular.isObject(chosen)
Expand Down

0 comments on commit 2bfc8da

Please sign in to comment.