Skip to content

Commit 7ec8ed6

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

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

dist/angular-selectize.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ 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.attr(prop)}, function(val) {
101+
element.siblings('.selectize-control').find('input').attr(prop, val);
102+
});
103+
});
104+
105+
97106
element.selectize(settings);
98107

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

0 commit comments

Comments
 (0)