Class: FormValidator

FormComponents. FormValidator


new FormValidator(schema)

A very simple class that handles checking if a resource is valid against a schema
and passing back errors if it is not.

When instantiated, binds the schema to the internal object for later validation.

Parameters:
Name Type Description
schema schema

A js-schema to validate the form's resource off of

Source:

Methods


<static> this.validate(resource)

Validates a resource against a FormValidator instance's schema.
If there are no errors passes back 'false'. Otherwise, returns an object of errors.

Parameters:
Name Type Description
resource *

A resource to validate.

Source:
Returns:
Type
boolean | object