ng-required stopped working,
I am using AngularJS Material tabs,
I have a condition inside each tab for "required" fields.
I have another condition for showing the tabs or not (ng-if).
plunker: http://next.plnkr.co/edit/g6tieIDq9yaEpNre
In this example, the submit button is not working, but the ng-required for the second input (the hidden one) is false!
another example with ng-repeat:
plunker: http://next.plnkr.co/edit/b7STJ5B4Ktcou83y
In this example, the submit button is not working, the second input (inside the ng repeat) is not required.
if we change angular version back to 1.7.5, its working as excepted.
AngularJS version: 1.7.6
Browser: [all ]
Thanks.
I can confirm that there is some kind of issue with 1.7.6 and ng-required. I have a test that fails in 1.7.6 but passes in 1.7.5
My test asserts that when I set an unrequired field to an empty value the ngModel should be $valid.
After some debugging it looks like my input has the attr ng-required="false" but also has a $error
On the input
In the input ngModelCtrl
After a bisect and symlinking to my test environment, the commit associated with this issue it 0637a2124c4515311a317e0e39926521228fc0af
Thanks for investigating it @codymikol, it looks like it's idd introduced in @Narretz commit to prevent multiple validators from initializing. Probably a good idea to get @Narretz involved in the PR review ( https://github.com/angular/angular.js/pull/16815 ).
We confirm the issue on the GlobaLeaks as reported by some users here: https://github.com/globaleaks/GlobaLeaks/issues/2495
We will release 1.7.7 early next week.
Most helpful comment
We will release 1.7.7 early next week.