API Docs for: 0.2.0
Show:

Validator.Rule Class

Extends Ember.Object
Module: Ember.Validator

The base rule class which stores the validate method and message settings.

Constructor

Validator.Rule

()

Item Index

Methods

Methods

validate

(
  • value
  • options
)
Boolean

Define validations in this method and return the Boolean value.

Parameters:

  • value
    • The property value to validate
  • options Object
    • The object validator with an object context included

Returns:

Boolean:

Properties

message

String

The property used to display the error message. Can be set to a customized message with formatting or without.

message is formatted like so:

Example:

// %@1: errorKey || propertyFormat
                    // %@2+: messageFormats
                    
                    '%@1 has invalid length, must be %@2 %@3 chars'.fmt(errorKey, messageFormats);
                    

errorKey is defaulted to %@1 and messageFormats are designated for %@2+

Related: errorKey

messageFormats

Array

Property used to customize the message formatting

propertyFormat

String

Set this property when you want to customize the message to show something other than the default errorKey.

See: Ember.Validator.Error/errorKey:property