Skip to content

Commit

Permalink
fix(attrs): make placeholder and title bindable
Browse files Browse the repository at this point in the history
  • Loading branch information
nbrustein committed Dec 7, 2015
1 parent d0d3fbf commit 7ec8ed6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dist/angular-selectize.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ 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
['placeholder', 'title'].forEach(function(prop){
scope.$watch(function() { return element.attr(prop)}, function(val) {
element.siblings('.selectize-control').find('input').attr(prop, val);
});
});


element.selectize(settings);

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

0 comments on commit 7ec8ed6

Please sign in to comment.