AngularJs 最新驗證手機號碼的實例,成功測試通過
更新時間:2017年11月26日 12:35:36 作者:峰雨同行
下面小編就為大家分享一篇AngularJs 最新驗證手機號碼的實例,成功測試通過,具有很好的參考價值。希望對大家有所幫助。一起跟隨小編過來看看吧
實例如下:
<form name="signUpForm" novalidate>
<div class="form-group">
<div class="row clearfix">
<label for="tel1" class="col-xs-12" style="text-align: left">L張蒙號碼1:</label>
<div style="text-align: center" class="col-xs-12">
<input id="tel1" type="tel" name="tel1"
data-ng-model="vm.tel1"
ng-minlength="11"
ng-pattern="/^1[3|5][0-9]\d{4,8}$/" required
style="width: 80%;font-size: large"
placeholder="請輸入號碼1:"/>
</div>
<div class="col-xs-12">
<p class="glyphicon glyphicon-ok input_result text-success"
ng-if="signUpForm.tel1.$valid"></p>
<p class="text-danger glyphicon glyphicon-remove"
ng-if="signUpForm.tel1.$error.required&&signUpForm.tel1.$touched">電話不能為空!</p>
<p class="text-danger glyphicon glyphicon-remove"
ng-if="(signUpForm.tel1.$error.minlength||signUpForm.tel1.$error.maxlength||signUpForm.tel1.$error.pattern)&&signUpForm.tel1.$touched">請輸入有效手機號!</p>
</div>
</div>
</form>
以上這篇AngularJs 最新驗證手機號碼的實例,成功測試通過就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。
您可能感興趣的文章:
相關文章
Angular 數(shù)據(jù)請求的實現(xiàn)方法
本篇文章主要介紹了Angular 數(shù)據(jù)請求的實現(xiàn)方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-05-05
深入淺析angular和vue還有jquery的區(qū)別
vue是一個漸進式的框架, 是一個輕量級的框架而angular是一個mvc框架, 各有千秋,下面小編通過本文給大家介紹angular和vue還有jquery的區(qū)別,感興趣的朋友一起看看吧2018-08-08
Angular2 組件間通過@Input @Output通訊示例
本篇文章主要介紹了Angular2 組件間通過@Input @Output通訊示例,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-08-08
angular框架實現(xiàn)全選與單選chekbox的自定義
這篇文章主要介紹了angular框架實現(xiàn)全選與單選chekbox的自定義,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-07-07

