aurelia / validatejs

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

Using validate binding behaviour but not calling ValidationEngine.getValidationReporter(this) causes the view to fail #37

Closed apawsey closed 8 years ago

apawsey commented 8 years ago

If you configure validation rules, and use the validate binding behaviour in you markup, but you do not call the getValidationReporter method, you get the following error...

ERROR [app-router] TypeError: Cannot read property 'subscribe' of undefined
    at ValidateBindingBehavior.bind (webpack:///./~/aurelia-validatejs/dist/commonjs/validate-binding-behavior.js?:31:13)
    at BindingBehavior.bind (webpack:///./~/aurelia-binding/dist/commonjs/aurelia-binding.js?:1195:19)
    at Binding.bind (webpack:///./~/aurelia-binding/dist/commonjs/aurelia-binding.js?:4672:29)
......

Surely this should be automatically called if it doesn't already exist as it seems to be some kind of singleton for each model?

plwalters commented 8 years ago

Duplicate of #25