用AngularJs指令做一个表单验证


Document

ng-model="un"

type="text"

required

ng-minlength="4"

ng-maxlength="12"

class="form-control"

>

  用户名应该在4-12位之间

ng-model="pw"

type="password"

required

ng-minlength="4"

ng-maxlength="12"

class="form-control"

>

{{signForm.password}}

ng-if="signForm.password.$invalid && signForm.password.$touched">

密码应该在4-12位之间

ng-model="pw2"

type="password2"

required

ng-minlength="4"

ng-maxlength="12"

class="form-control"

>

{{signForm.password2}}

       

你可能感兴趣的:(用AngularJs指令做一个表单验证)