How to access validation from inside the view model?
The latest release broke my validation flow, because previously i was able to call .isValid() and .showAllMessages() from inside my view model without manually creating a group but by simply calling ko.validatedObservable(new MyViewModel()).
Adding a validatedObservable to the view model like self.validation = ko.validatedObservable(self) creates a circular reference which prevents immediate serialization.
The only workaround that I've found is creating a temporary validatedObservable variable each time I have to validate my view model.
Are there any better options?
The return value of ko.validation.group no longer attaches those properties to the view model. Instead these properties go on the return value - except isValid which is equivalent of result().length === 0. I've created a simple fiddle for this purpose. http://jsfiddle.net/rsu2eq9j/
Consider checking the release notes for other breaking changes that might affect your code.
@rudym87 Can we close this?
Yes, go ahead. Thanks for your fiddle.