diff --git a/dist/angular-selectize.js b/dist/angular-selectize.js index a009975..af9cfe0 100755 --- a/dist/angular-selectize.js +++ b/dist/angular-selectize.js @@ -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() {