I came across a post on StackOverflow discussing the issue of both "myForm.$valid" and "myForm.$invalid" being undefined on an Angular form.
However, my problem is slightly different. I have defined a form like this:
<form name="EntityForm" role="form" novalidate ng-submit="EntityForm.$valid && save()" id="EntityForm"></form>
I also have a Modal that opens this form template. At certain points in my program, when the Modal opens, the form looks like this:
<form name="EntityForm" role="form" novalidate="" ng-submit="EntityForm.$valid && save()" id="EntityForm" class="ng-pristine ng-scope ng-invalid ng-invalid-required ng-valid-maxlength ng-valid-pattern ng-invalid-iran-national-id ng-valid-minlength"></form>
While at other times, it translates to something like this:
<form name="EntityForm" role="form" novalidate="" ng-submit="EntityForm.$valid && save()" id="EntityForm" class="ng-pristine ng-scope ng-valid-maxlength ng-pending ng-invalid-required ng-valid-pattern ng-invalid-iran-national-id ng-valid-minlength"></form>
Upon comparing these two situations, I noticed that AngularJS does not seem to resolve "ng-invalid" correctly in the second scenario.
How could it be possible for AngularJS to not properly handle valid and invalid directives on a form?
Thank you in advance.