Skip to content

Commit 01ad9c2

Browse files
committed
fix(attrs): make placeholder and title bindable
1 parent d0d3fbf commit 01ad9c2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

dist/angular-selectize.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ angular.module('selectize', []).value('selectizeConfig', {}).directive("selectiz
9494
scope.$watch('ngDisabled', toggle);
9595
};
9696

97+
// watch for changes to attributes that are copied down to the
98+
// input and keep them in sync
99+
['placeholder', 'title'].forEach(function(prop){
100+
scope.$watch(function() { return element && element.attr(prop); }, function(val) {
101+
if (element) {
102+
element.siblings('.selectize-control').find('input').attr(prop, val);
103+
}
104+
});
105+
});
106+
107+
97108
element.selectize(settings);
98109

99110
element.on('$destroy', function() {

0 commit comments

Comments
 (0)