Ember.Validator Class
Item Index
Methods
_createResultMessage
-
errorKey
-
rule
Creates the error message.
Parameters:
-
errorKey
String -
rule
Ember.Validator.Rule
_formatMessage
-
rule
-
propertyFormat
-
messageFormats
Formats the message based on the errorKey and messageFormats. The errorKey is always set as the first argument
Related: propertyFormat, messageFormats
Parameters:
-
rule
Ember.Validator.Rule -
propertyFormat
String -
messageFormats
Array
Returns:
The formatted string
_generateResult
-
context
-
rules
-
key
Responsible for running validation rules and adding the error to an instance of Ember.Validator.Error.
Result generation will stop at the first failed validation per key.
Parameters:
-
context
Object- The object doing the validation
-
rules
Array- rule names defined as strings
-
key
String- the current property being validated
_getRuleObj
-
context
-
key
-
ruleName
Looks for a rule object defined as custom or defined in {@link Ember.Validator.Rules}. Any custom rules with the same name in {@link Ember.Validator.Rules} are merged.
Parameters:
-
context
String -
key
String -
ruleName
String
Returns:
- The rule object
_getRulesForKey
-
key
Looks for rules property in the errorKey set in validations
Parameters:
-
key
String
Properties
trim
Boolean
Option to trim whitespace from string values before validation.
Default: true
trimApply
Boolean
Option to set the trimmed value on the object. Trim must be true for this to work.
Default: true