AngularJS directive for caret aware elements