Angularjs 计数器仅在ng minlength检查完成后更新

Angularjs 计数器仅在ng minlength检查完成后更新,angularjs,Angularjs,ng minlength完成后,计数器会更新…它最初不会更新。 问题应该是什么 <div class="col-xs-12"> <div class="form-group"> <label class="_500">Title of the {{ ::CreatePostVm.postTypeTitle }}</label> <input name="postTitle" type="text" autofocus

ng minlength完成后,计数器会更新…它最初不会更新。 问题应该是什么

<div class="col-xs-12">
    <div class="form-group">
    <label class="_500">Title of the {{ ::CreatePostVm.postTypeTitle }}</label>
    <input name="postTitle" type="text" autofocus ng-model="CreatePostVm.post.title" placeholder="Write the title of your {{ ::CreatePostVm.postTypeTitle }} here..." ng-minlength="10" ng-maxlength="100" minlength="10" maxlength="100" required class="form-control" />
   <div class="row">
       <div class="col-xs-12 col-xs-8">
           <div ng-messages="createPost.postTitle.$error" role="alert" class="ng-validation-messages m-t-xs">
               <div ng-message="required">Title is needed to summarize your {{ ::CreatePostVm.postTypeTitle }}</div>
               <div ng-message="minlength">Title should be minimum 10 characters long</div>
               <div ng-message="maxlength">Title should be maximum 100 characters long</div>
           </div>
       </div>
       <div class="col-xs-12 col-xs-4">
           <div class="helper-text text-right">
               <span class="small text-muted">
                   <span>{{ CreatePostVm.post.title.length || 0 }}</span>/100
               </span>
          </div>
       </div>
  </div>

{{::CreatePostVm.postTypeTitle}的标题
需要标题来总结您的{{::CreatePostVm.postTypeTitle}
标题长度至少应为10个字符
标题长度不得超过100个字符
{{CreatePostVm.post.title.length | | 0}/100

ng minlength是一个验证指令,如果输入有效,则只将值更新为ng model,如果值无效,则不将其更新为model

有关更多信息,请查看


有一个minLength的例子,如果minLength不满足要求,则模型值显示为空。

so..是否有其他方法在输入字符后立即更新计数器