Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

i want to inject new line between error message. #100

Closed
ghost opened this issue Jan 6, 2016 · 4 comments
Closed

i want to inject new line between error message. #100

ghost opened this issue Jan 6, 2016 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 6, 2016

how can i?

@ghiscoding
Copy link
Owner

The error messages are concatenated and I won't change that behavior. So basically, there is no way of separating them and I will not change my code either.

On the other hand, if you find the message to be too long, you could display only the last error. See the Wiki - Global Options with the option of displayOnlyLastErrorMsg: true

@ghiscoding
Copy link
Owner

If you want to make a pull request though, I might accept it... but I just don't want to spend time on this myself.

@ghiscoding ghiscoding removed the wontfix label Jan 7, 2016
ghiscoding added a commit that referenced this issue Jan 17, 2016
- Enhancement #100, add Global Option (errorMessageSeparator) for a
Separator between error messages.
- Enhancement #101, add Global Option (preValidateValidationSummary) to
disable pre-validation in Validation Summary if need be.
- Also found and fixed a problem with a try-catch throw javascript error
in Custom Validation.
@ghiscoding
Copy link
Owner

Added a new Global Option named errorMessageSeparator, this separator is HTML based and so if you want a new line, you would use <br/>.

Your code could look like this:

var vs = new validationService({ errorMessageSeparator: "<br/><li>" });

Please note that the Validation Summary will also contain the extra HTML code and to display proper HTML code with an ngRepeat, you will need to use ngSanitize and ng-bind-html

If you like the Angular-Validation package, you can also click on Star on top, if you haven't done it already. Thanks

@ghost
Copy link
Author

ghost commented Jan 20, 2016

thanks ^^

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

No branches or pull requests

1 participant