From 7ec8ed611daf59b64aff39c588fb32e5295021ac Mon Sep 17 00:00:00 2001 From: Nate Brustein Date: Mon, 7 Dec 2015 12:25:03 -0500 Subject: [PATCH] fix(attrs): make placeholder and title bindable --- dist/angular-selectize.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dist/angular-selectize.js b/dist/angular-selectize.js index a009975..2938d7d 100755 --- a/dist/angular-selectize.js +++ b/dist/angular-selectize.js @@ -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() {