Commit 5659756
committed
Allow injecting validate.js options
It's now possible to set up a static `validatorOptions` object in the stimulus
controller. This object will be used to pass any extra options accepted by validate.js.
Eg, validate.js has an option to skip prepending the error msgs with the attr name: `fullMessages`.
When setting this option to false, instead of an error msg being "Foo can't be blank", it'll be
"can't be blank".
It's now easy to pass this option by setting:
static rules = {...}
static validatorOptions = { fullMessages: false }
---1 parent f50772a commit 5659756
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
63 | 71 | | |
64 | 72 | | |
65 | 73 | | |
| |||
0 commit comments