-
Notifications
You must be signed in to change notification settings - Fork 567
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
Asynchronous resolution of validation messages #334
Comments
Guess I found something which fulfils partially what I'm asking: https://github.com/formly-js/ng2-formly/blob/503e803e27896f73042ef3024cad8321adf4a749/demo/hello.ts#L221
But it seems to only work when an |
There's #307 that's in the pipeline. We hope that someone can help us with it by making their first PR for the repo 😁 |
This sounds good, but I'm not sure that's exactly the same. Does |
For that you always have setValidator in FormlyConfig https://github.com/formly-js/ng2-formly/blob/master/src/core/services/formly.config.ts#L138 |
We are getting closer. So much like this in forRoot, but instead directly in the component https://github.com/formly-js/ng2-formly/blob/master/demo/hello.ts#L552 ? However this does not seem to be the place where the messages can be customized, isn't it? Feels like |
Makes sense 👍 I thought there is already a way for that. Can you make a PR for that? |
While trying to make the PR, I realized that actually it already exists... Just need to include the service It works also when wrapped into a setTimeout so ultimately, that's all what's needed I guess |
Using ngx-formly 4.8.0, you now include
|
**I'm submitting a Feature (or Support) request ** (check one with "x")
Current behavior
This is possible to customise validation messages in the
forRoot
function. However, even so it's possible to tweak the messages a bit by using a synchronous function, this does not seem possible to resolve messages asynchronously, through e.g. Observable (let me know if I missed something).Expected behavior
Depending on the user language filling the form, it would be great to have an advanced customisation of error messages. Observable would give the possibility to fetch data possibly remotely.
What is the motivation / use case for changing the behavior?
More flexibility
The text was updated successfully, but these errors were encountered: