Skip to content
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

Allow custom error message resolvers #24

Open
ShaneYu opened this issue Jan 12, 2017 · 3 comments
Open

Allow custom error message resolvers #24

ShaneYu opened this issue Jan 12, 2017 · 3 comments

Comments

@ShaneYu
Copy link
Contributor

ShaneYu commented Jan 12, 2017

This entire project is great, especially the level of customization, however I've found a place of extension and want to raise a feature/enhancement issue.

I am happy to fork this repository, make the changes and then request a pull back in. 😄

Currently, when a error message is shown via the simple or tooltip message services, they get the message from the validation service by called 'getErrorMessage' which then internally calls 'resolveMessage'. At this present time, resolveMessage will just attempt to get the message from the global config of messages, however it would be great to be able to have a custom message resolve service that could be called to. This would mean we could create a message resolve service that, for example, uses angular translate to get the messages from translation files instead, of from a reference data service that fetches data from a web api and caches etc; there are many possibilities.

I propose we allow the ability for developers to create custom resolvers for the messages and just have a default one that falls back to the current config.

Is this a feature you would be happy to merge in should someone code it?

@sagrawal31
Copy link
Owner

Thanks @ShaneYu. Glad you found this helpful! The new feature you suggested is amazing. I'm running busy from quite a few months otherwise I would like to implement this but yes, of course, I'll be happy to merge in others contributions.

@ShaneYu
Copy link
Contributor Author

ShaneYu commented Jan 12, 2017

Thanks for the quick reply @sagrawal14.

I've implemented support for filters on the messages already on my machine, I was thinking to commit and request a merge on that also. It allows the developer to specify one or more angular filters to apply to messages prior to resolving/returning them; I will try to commit and request a pull-request by lunch time.

Then I will look into implementing this feature.

@sagrawal31
Copy link
Owner

sagrawal31 commented Jan 12, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants