aurelia / validatejs

Enables expressive validation using decorators and/or a fluent API.
MIT License
22 stars 23 forks source link

Allow global options for the validate function #109

Closed sifrenette closed 8 years ago

sifrenette commented 8 years ago

Right now there is no convenient way to pass global options to the validate function from validatejs. Example: I want to set the fullMessages option to false so I can use i18n on the error messages.

I think a good way to implement it would be to add an optional options argument to the Validator class constructor (also maybe as an argument to the exported configure function so we can pass it to the Validator instantiation).

Ex:

export function configure(config, options) {
  config.container.registerInstance(ValidatorInterface, new Validator(options));
}
jdanyow commented 8 years ago

internationalization support was improved in the last release- check out the docs