-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Selectize.ClearOptions() doesn't work when loading data dynamically. #94
Comments
Pull request #95 should fix this issue |
Typo fix
Same issue here and the suggested fix works perfectly for me. |
Hmm.. my thought so far is that users should be using angular to manipulate their options. They shouldn't be calling selectize.clearOptions(). They should use $scope.options = []. So the directive shouldn't need to listen for that event. |
If the user is loading data from remote source, they don't have direct access to $scope.options. Also, the original library has the functionality of clearing options, I think angular-selectize should too. |
Again, if the data is a remote source, it should be loaded in an Angular controller, and assigned to the Angular model. |
The data loading is not the problem here, the problem is once the loaded data is cleared, the value of $scope.options variable in this directive doesn't match the source data inside the selectize library. |
Since this is an Angular directive, the expectation is that the user will rely on Angular for loading options. |
Since angular-selectize doesn't listen for selectize clear event, the options in directive memory become stale if selectize.clearOptions() is called.
Due to this, new data keeps getting appended to the existing options.
The text was updated successfully, but these errors were encountered: