试试这个:
<form role="form" method="post" name="registration" novalidate> <div ng-> <label for="inputPhone" >Phone :</label> <div > <input type="number" ng-minlength="10" ng-maxlength="10" id="inputPhone" name="phone" placeholder="Phone" ng-model="user.phone" ng-required="true"> <span ng-show="registration.phone.$error.required || registration.phone.$error.number"> Valid phone number is required </span> <span ng-show="((registration.phone.$error.minlength || registration.phone.$error.maxlength) && registration.phone.$dirty) "> phone number should be 10 digits </span>



