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
[Angular] Identifier 'required' is not defined. '__type' does not contain such a member #152
Comments
Closing because duplicate of #149 |
I have tried with above approach but it failed miserably. Please look at this code - This field is required
Minimum length should be {{username.errors.minlength.requiredLength}}
Throwing error by TS compiler - |
i tried same thing bu tnot getting out put |
Example |
First Name is required.
i tried this
First Name should be minimum 3 character.
First Name doesn't Match pattern.
|
|
this will solve the issue: |
I solved this issue adding ? before parameter and not after errors? But can you please elaborate it and try to explain how this issue is solved just by moving the question mark? @Danielapariona |
This solved my issue! thanks! |
It worked for me. Could you please tell me why should add "?" |
this also solve my issue just add ? |
But neither casting as boolean or using the ?(may not have) doesn't solve the fact that the intelliSense can't find the properties of errors. |
try price['errors']['required'] |
@EeeEui the ? (safe navigation operator) will take a variable even if it's might be invalid and deal with the exception internally (invalid = false in this case). |
|
#? didn't work f. !! only worked in angular 7+.
|
This worked for me and it looks cleaner. |
I had the same error. Doing |
Do *ngIf="yourForm.get('yourfield').hasError('required')" |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
property errors of AbstractControlDirective
I have the following code:
By using a property inside the
errors
property of the ngModel reference it shows me that error.This shouldn't be an error since it's valid syntax for template-driven forms.
The text was updated successfully, but these errors were encountered: