-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ng-required is not working with ng-if #1144
Comments
May be related to this one #1052 In my case the initial value is a valid File object. Because |
After a bit of investigation i noticed that this will never work because a big part of the validation logic it was designed around that input[file] and there is no way to do 2way binding with it. Do you plan in the feature to refactor this around |
input file is kind of different from other inputs in the way that you cannot set a value for it programmatically, so there is no two way binding you can just set it to null. |
Actually it is already tied to the model only. I am guessing when you have ng-if it would reset the model values that are bind to the newly compiled elements. If you could create a jsfiddle showing the issue I will investigate more. |
Hello, I design an editor where user needs to select a contentType from editor menu and each menu tab has its own validation rules depends on their content types. So, some content types has file selector where I use your directive and its validations for it but when user select a content type and make it valid then move to another content type and turn back again valid nested form become invalid because of ng-if. I reproduced the error from your demos at home page. Here is the link for it http://jsfiddle.net/0rgm4az4/ For who looking for temporary solution you could use ng-show but then you need to put ng-show condition with ng-required for dynamic validation for invisible areas... @danialfarid could you reopen this issue please? |
Fixed at 12.2.11 |
Hi,
If i use the component with
ng-required
inside anng-if
whenng-if
changes the model is not valid anymore. Take the following use case:5 required is invalid, if i change the file it becomes valid again.
The text was updated successfully, but these errors were encountered: