<form name="form1" ng-app=""> <input type="text" name="account" ng-model="userAccount" ng-minlength="3" ng-maxlength="5" required autocomplete="off" /><br /> {{ form1.account.$error }} </form>