Validation

Basic Validation

To display validation errors, the form controls must have a name and be bound to a model using ngModel.
Put inputs inside a ng1-form-field to display error messages and apply validation styles.

File Validation

The following validators are available for file inputs:

  • ng1FileMinSize: Minimum file size in bytes.
  • ng1FileMaxSize: Maximum file size in bytes.
  • ng1FileExtension: Allowed file extensions (e.g. .jpg, .png).

Note: These validators require the ng1File directive to be placed on the input element.

On this page: