Skip to content
This repository was archived by the owner on Aug 15, 2021. It is now read-only.
This repository was archived by the owner on Aug 15, 2021. It is now read-only.

Passing a parameter from a Custom Validator directive to errorMessages doesn't work unless you make errorMessages dash-case. #165

@dustin-page

Description

@dustin-page

It looks like the attribute on the input must match with dash-case for the "errorMessages" in the Error Message Resolver. Angular-auto-validate doesn't convert it to camel case even though the example for the "Error Message Resolver" documentation on the angular-auto-validate website shows it this way.

Using dash-case as the key for the "errorMessages" allows the value of "2" to be included where {0} is referenced in the errorMessages string.

The following works:
<input type="hidden" class="form-control" ng-model="cc.bundleData.items" min-required-items-in-bundle="2" />

errorMessages['min-required-items-in-bundle'] = 'Please include at least {0} items';

This doesn't work:
(The camel case for "anotherErrorMessage" won't work because it doesn't match the case of the attribute name on the input element which would be "another-error-message"):
errorMessages['anotherErrorMessage'] = 'An error message with the attribute value {0}';

Please update the code to support errorMessages with camel cases. Or update the documentation on the website for the "Error Message Resolver".

By the way this is a great module!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions