I have this custom directive:
eDiscovery.directive('customHighlightUsername', function () {
return {
restrict: 'A',
link: function ($scope, elem, attrs) {
elem.bind('change', function () {
console.log('bind works'); // this does not work
});
elem.on('blur', function () {
console.log('blur works'); // this works
});
elem.on('change', function () {
console.log('change works'); // this does not work
});
}
}
});
and here is my HTML:
<input custom-highlight-username
type="text"
style="display: initial;"
ng-model="assignSelectedQuestionsInput"
placeholder="Assign users to selected questions:"
class="form-control">
For whatever reason, the on('blur')
callback is working in my directive, but the on('change')
and bind('change')
callbacks do not fire as expected. As you can see, this is a text input field - when new characters are entered into the field, I would expect the change callbacks to fire.
Does anyone know why that might happen?