次の入力があり、ぼかしイベントでモデルを更新します。
<input
es-max-type
class="headline"
ng-change="edit(selectedRow, '{{selectedRow.name}}');"
ng-model="selectedRow.name"
ng-model-options="{ updateOn: 'blur' }"/>
es-max-type ディレクティブは文字列の長さを監視しています。
scope.$watch(function() {
return scope.ngModel
}, function(text) {
if(text) {
scope.currentLen = text.length;
}
});
入力がフォーカスされるたびに、コーナーに「15/100」の文字数を表示しています。しかし、モデルはぼかしイベントでのみ更新されるため、編集中の変更を追跡できません。ぼかしの更新を削除せずに文字列の長さを取得する方法はありますか?