Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions dist/angular-selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,23 @@ angular.module('selectize', []).value('selectizeConfig', {}).directive("selectiz
scope.$watch('ngDisabled', toggle);
};

// watch for changes to attributes that are copied down to the
// input and keep them in sync. We have set the attr in the watch expression
// rather than in the listener because after an update the selectize library
// may have reverted the placeholder to the un-interpolated value even though
// the value of element.attr(prop) has not changed
var input;
['placeholder', 'title'].forEach(function(prop){
scope.$watch(function() {
if (element) {
var val = element.attr(prop);
input = input || element.siblings('.selectize-control').find('input');
input.attr(prop, val);
}
});
});


element.selectize(settings);

element.on('$destroy', function() {
Expand Down