Home

Awesome

Ember Validators

Build Status npm version

A collection of EmberJS validators

ember install ember-validators

Helpful Links

Looking for help?

If it is a bug please open an issue on GitHub.

Usage

Validators can be individually imported and used as such

import validatePresence from 'ember-validators/presence';
import validateLength from 'ember-validators/length';

validatePresence('foo', { presence: true });
validateLength('foo', { min: 1 });

or via the validate method provided

import { validate } from 'ember-validators';

validate('presence', 'foo', { presence: true });
validate('length', 'foo', { min: 1 });

Validator Method Signature

Each validator has the following signature:

function (value, options, model, attribute) {}

Parameters:

Returns: