-
Notifications
You must be signed in to change notification settings - Fork 8
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
directive: add support for nested groups #21
Comments
Could you please provide some examples of what you have in mind ? 😊 |
Yes, sorry I had some difficulty explaining. 😅 <form>
<div ngxFormErrorsGroup="register-group">
<input formControlName="userName" />
<div ngxFormErrorsGroup="password-group">
<input formControlName="password" />
<input formControlName="repeatPassword" />
</div>
</div>
</form> and your config: const errorMessages = {
required: "This is required",
"register-group": {
required: "Field is required for registering",
"password-group": {
passwordRepeat: {
required: "Please validate your password"
}
}
}
}; The error message for |
To support nested groups I don't think we need to add anything to the logic, but changing the type of the directive in the constructor would make it possible. Changing
|
I'm submitting a...
Currently messages are stored as
{group?}.{formControlName?}.{error}
meaning an error can only be specified for it's nearest group. I propose we allow nesting groups so the format will be{[group]?}.{formControlName?}.{error}
.The text was updated successfully, but these errors were encountered: