I am using ng-class to add submitted class to my inputs when form is submitted like
<form name="myform" novalidate>
<input name= "input1" ng-class="{'submitted':myform.$submitted}" ng-model=data.input1/>
.....
....
</form>
Although it gets the job done but it is too verbose and I have many inputs where I need this. I want to create a directive to make my html look like
<form name="myform" novalidate>
<input name= "input1" set-submitted ng-model=data.input1/>
.....
....
</form>
How can I create a directive for this purpose?
ng-submittedclass is automatically added to the form when it is submitted