0

I have following input and it updates model on blur event.

<input
  es-max-type
  class="headline"
  ng-change="edit(selectedRow, '{{selectedRow.name}}');"
  ng-model="selectedRow.name"
  ng-model-options="{ updateOn: 'blur' }"/>

es-max-type directive is watching for string length.

scope.$watch(function() {
    return scope.ngModel
}, function(text) {
    if(text) {
        scope.currentLen = text.length;
    }
});

Whenever input is focused I'm showing in corner "15/100" number of characters. But since model is updated only on blur event, I'm unable to track changes during editing. Is there a way to get string length without removing update on blur?

Erazihel
  • 7,295
  • 6
  • 30
  • 53
vromanch
  • 939
  • 10
  • 22

1 Answers1

0

Try to listen "input" event. And not "change" or "blur"

Cristian S.
  • 937
  • 5
  • 13