1

I'm using Aurelia-validation, and I've created a validation-controller that can on demand run validate( object: myObj, propertyName: "myProp", rules : MyRules)

Documentation: https://aurelia.io/docs/plugins/validation#validation-controller

For some reason I get, what I can only describe as a conflict, in my validation result object. The only rule I validate on is "required()", and it returns true. However, the result object as a whole returns false. Why is that?

Take a look (using my real data):

Rule says valid, object says not valid

robertpaulsen
  • 209
  • 4
  • 9

2 Answers2

1

Take a close look to your "valid" type. One is Boolean and the other is a String! Check if you can take control of that!

  • Yes, I see the plugin returns a string on the overall validation result, but bool on the individual rules that are run (which in my case is only the one). Can you explain what you mean by me taking control of it? Change their code? – robertpaulsen Oct 25 '18 at 06:38
  • I am sorry! I should have read more! Let me guess! The main valid field belongs to the form and the valid inside the first position of the array belongs to an input? – Andre Ferreira Oct 25 '18 at 08:12
0

I suppose it has something to do with chrome dev tools, because it seem to happen only when I inspect it while it's running, and not when I console.log() the values and let it finish, Then they correspond to each other. Oh well!

robertpaulsen
  • 209
  • 4
  • 9