Edit in JSFiddle

<form name="form1" ng-app="">
    帳號:
    <input type="text"
        name="account"
        ng-model="userAccount"
        ng-minlength="3"
        ng-maxlength="8"
        placeholder="帳號長度 3 ~ 8"
        autocomplete="off"
    />
</form>
input.ng-invalid {
    border: 1px solid red;
    background: red;
    padding: 5px;
}