Closed drdwilcox closed 8 years ago
I'm trying to get this in to todays' release -
class Model {
@required name = '';
}
let obj = new Model();
this.validator = new Validator(obj);
this.validator.validate();
does this look like it covers your scenarios for now? The API still may be in flux a bit over the next week so improvements or suggestions welcome.
I believe it would. It has the advantage of being similar to the mechanism for the fluent api, so switching from one to the other would be intuitive.
Should be in yesterdays release.
I have a model that uses decorators to set validation rules. And I'm using
ValidationEngine,getValidationReport(this.model);
this.subscriber = this.reporter.subscribe(result => {...});
If the user doesn't change any fields, the observer never gets called, so I don't see any errors. I would like to be able to force the validation in my submit action just to make sure it's actually been done.