<form name="form"> <label for="input">姓名</label> <input name="input" ng-maxlength="10" required></input> <span id="sp1" ng-show="!form.input.$pristine">name is required</span> <span id="sp2" ng-show="form.input.$invalid">max length is 10</span> </form>
Anguarljs表單驗證的參考文件:http://www.cnblogs.com/rohelm...
Anguarljs表單驗證的參考文件:
http://www.cnblogs.com/rohelm...