问题
Is is possible to see if just one property is valid in the knockout-validation plugin?
I could not see any reference to it in the documentation, only the ability to see if the whole model is valid.
For example I wish a computed observable to have a different value depending upon if another observable is valid.
回答1:
I was being led down the wrong direction, as I was using async validators and over complicated my problem, I think it is as simple as:
propertyName.isValid();
e.g.
self.email.isValid();
来源:https://stackoverflow.com/questions/14776948/knockout-validation-plugin-get-isvalid-from-specific-property