error
ErrorAn alias to the first Error in the errors collection.
// Example
get(user, 'validations.error')
get(user, 'validations.attrs.username.error')
errors
ArrayA collection of all Errors on the object in question. Each error object includes the error message and it's associated attribute name.
// Example
get(user, 'validations.errors')
get(user, 'validations.attrs.username.errors')
hasWarnings
StringWill be true
if there are warnings in the collection.
// Example
get(user, 'validations.hasWarnings')
get(user, 'validations.attrs.username.hasWarnings')
isAsync
BooleanWill be true
only if a validation returns a promise
// Examples
get(user, 'validations.isAsync')
get(user, 'validations.attrs.username.isAsync')
Default: false
isDirty
BooleanWill be true is the attribute in question is not null
or undefined
. If the object being
validated is an Ember Data Model and you have a defaultValue
specified, then it will use that for comparison.
// Examples
// 'username' : DS.attr('string', { defaultValue: 'johndoe' })
get(user, 'validations.isDirty')
get(user, 'validations.attrs.username.isDirty')
Default: false
isInvalid
Boolean// Examples
get(user, 'validations.isInvalid')
get(user, 'validations.attrs.username.isInvalid')
Default: false
isTruelyInvalid
BooleanWill be true only if isValid is false
and isValidating is false
// Examples
get(user, 'validations.isTruelyInvalid')
get(user, 'validations.attrs.username.isTruelyInvalid')
Default: false
isTruelyValid
BooleanWill be true only if isValid is true
and isValidating is false
// Examples
get(user, 'validations.isTruelyValid')
get(user, 'validations.attrs.username.isTruelyValid')
Default: true
isValid
Boolean// Examples
get(user, 'validations.isValid')
get(user, 'validations.attrs.username.isValid')
Default: true
isValidating
BooleanThis property is toggled only if there is an async validation
// Examples
get(user, 'validations.isValidating')
get(user, 'validations.attrs.username.isValidating')
Default: false
message
StringAn alias to the first message in the messages collection.
// Example
get(user, 'validations.message')
get(user, 'validations.attrs.username.message')
messages
ArrayA collection of all error messages on the object in question
// Examples
get(user, 'validations.messages')
get(user, 'validations.attrs.username.messages')
options
ObjectAll built options of the validators associated with the results in this collection grouped by validator type
// Given the following validators
{
username: [
validator('presence', true),
validator('length', { max: 15 }),
validator('format', { regex: /foo/ }),
validator('format', { regex: /bar/ }),
]
}
get(user, 'validations.attrs.username.options')
The above will return the following
{
'presence': { presence: true},
'length': { max: 15 },
'regex': [{ regex: /foo/ }, { regex: /bar/ }]
}
warning
ErrorAn alias to the first Warning in the warnings collection.
// Example
get(user, 'validations.warning')
get(user, 'validations.attrs.username.warning')
warningMessage
StringAn alias to the first message in the warningMessages collection.
// Example
get(user, 'validations.warningMessage')
get(user, 'validations.attrs.username.warningMessage')
warningMessages
ArrayA collection of all warning messages on the object in question
// Examples
get(user, 'validations.warningMessages')
get(user, 'validations.attrs.username.warningMessages')