Skip to content

Latest commit

 

History

History
157 lines (76 loc) · 2.63 KB

api.md

File metadata and controls

157 lines (76 loc) · 2.63 KB

Public API

API documentation automatically generated by docmeteor.


File: "lib/client/formly-validator.js" Where: {client}


formlyValidator {any}  Client


AngularJS Service

formlyValidator.register(name, expression)  Client


Register validator

This method register is defined in formlyValidator

Arguments

  • name {string}

validator identifier

  • expression {function}

like formly expression but with field validator configuration as first argument

formlyValidator.setFieldValidator(field, name, config)  Client


Add validator to field

This method setFieldValidator is defined in formlyValidator

Arguments

  • field {object}

formlyConfig of field

  • name {string}

validator name

  • config {Any}

field validator configuration

formlyValidator.getFieldValidator(field, name)  Client


Get validator configuration of field

This method getFieldValidator is defined in formlyValidator

Arguments

  • field {object}

formlyConfig of field

  • name {string}

validator name

Returns {Any} validator configuration for field

formlyValidator.createError(msg)  Client


Create Error object with prefixed message

This method createError is defined in formlyValidator

Arguments

  • msg {string}

error message

Returns {Error}

formlyValidator.isEmpty(value)  Client


Checks if variable is empty

This method isEmpty is defined in formlyValidator

Arguments

  • value {Any}

value to check

Returns {boolean}

formlyValidator.parseRegExp(regexp)  Client


You can put string representation of RegExp object (for example "[a-z]+") or just RegExp object.
Adds ^ and $ to string representation and returns undefined if it is not a string or RegExp object.

This method parseRegExp is defined in formlyValidator

Arguments

Returns {RegExp}