验证输入时,字段标签消失

时间:2015-10-11 16:24:31

标签: angularjs validation

我有一个非常简单的形式和一个奇怪的行为:

<form name='signup_form' novalidate ng-submit=signupForm()>
  <div class="row">
    <div class="large12 columns">
      <label>Email</label>
      <input type="email" placeholder="Email"
        name="email"
        ng-model="signup.email"
        required />
      <div class="error" ng-show="signup_form.email.$dirty && 
                                  signup_form.email.$invalid">
        <small class="error" ng-show="signup_form.email.$error.required">
          Email address is required
        </small>
        <small class="error" ng-show="signup_form.email.$error.email">
          This is not a valid email
        </small>
      </div>
    </div>
  </div>
  <button type='submit' class="button radius">Submit</button>
</form>

键入电子邮件......:

Invalid email

仍在打字 - 让它有效......:

Valid email

当我点击页面上的任何地方时,标签不同意它会显示回来。

Angular.js:https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.js

我没有使用任何自定义CSS。

Chrome检查无效:

Valid inspect

Chrome检查有效:

enter image description here

0 个答案:

没有答案