Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ng-required stopped working inside ng-if or ng-repeat, version 1.7.6 #16814

Closed
@korengal

Description

@korengal
  • [ X] bug report

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.

Activity

changed the title [-]ng-required stopped working on 1.7.6 gravity-manipulation (2019-01-17)[/-] [+]ng-required stopped working on 1.7.6 inside ng-if or ng-repeat[/+] on Jan 18, 2019
changed the title [-]ng-required stopped working on 1.7.6 inside ng-if or ng-repeat[/-] [+]ng-required stopped working inside ng-if or ng-repeat, version 1.7.6[/+] on Jan 18, 2019
codymikol

codymikol commented on Jan 18, 2019

@codymikol

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

image

In the input ngModelCtrl

image

After a bisect and symlinking to my test environment, the commit associated with this issue it 0637a21

added 2 commits that reference this issue on Jan 18, 2019
0693a37
e3e15e4
frederikprijck

frederikprijck commented on Jan 19, 2019

@frederikprijck
Contributor

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 ( #16815 ).

added this to the 1.7.x milestone on Jan 20, 2019
self-assigned this
on Jan 20, 2019
added a commit that references this issue on Jan 21, 2019
734bf11
added a commit that references this issue on Jan 21, 2019
c3ff296
evilaliv3

evilaliv3 commented on Jan 24, 2019

@evilaliv3

We confirm the issue on the GlobaLeaks as reported by some users here: globaleaks/globaleaks-whistleblowing-software#2495

13 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
ng-required stopped working inside ng-if or ng-repeat, version 1.7.6 · Issue #16814 · angular/angular.js