kzn,
<div class= "form-group" id="innblock" ng-class="{error: myForm.inn.$invalid}">
<label> ИНН </label>
<div>
<input name="inn" id="iinn" pattern="\d+" ng-model="agent.inn" type= "text" class= "form-control" maxlength="12" placeholder="ИНН" required/>
<span ng-show="myForm.inn.$dirty && myForm.inn.$invalid" class="help-inline">Введите ИНН</span>
</div>
</div>
<script>
var ell = document.querySelector("div.form-group input[name=inn]");
ell.setAttribute("maxlength", "10");
</script>