Skip to content
This repository has been archived by the owner. It is now read-only.

ember-bootstrap/ember-bootstrap-validations

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Ember-bootstrap-validations

Build Status

DEPRECATED

This addon is deprecated and no longer maintained!

This Ember addon adds support for validations based on ember-validations to ember-bootstrap forms. ember-bootstrap versions before 0.7.0 came with built-in support for ember-validations, all versions starting at 0.7.0 need an additional addon that implements validation support for the particular validation library. This addon delivers support for ember-validations.

Installation

ember install ember-bootstrap-validations

You should have installed the ember-bootstrap and ember-validations addons already. If not install them:

ember install ember-bootstrap
ember install ember-validations

If using ember-bootstrap 1.0 (alpha), install the corresponding version of this addon:

ember install ember-bootstrap-validations@1.0.0-alpha

Usage

Add validations to your model:

import DS from 'ember-data';
import EmberValidations from 'ember-validations';

export default DS.Model.extend(EmberValidations, {
  username: DS.attr('string'),
  email: DS.attr('string'),
  password: DS.attr('string'),

  validations: {
    'username': {
      presence: true,
      length: { minimum: 6 }
    },
    'email': {
      presence: true
    },
    'password': {
      presence: true,
      length: { minimum: 8 }
    }
  }
});

Then assign the model to your form:

{{#bs-form model=model}}
    {{bs-form-element label="Username" controlType="text" property="username" required=true}}
    {{bs-form-element label="Email" controlType="email" property="email" required=true}}
    {{bs-form-element label="Password" controlType="password" property="password" required=true}}
    {{bs-button defaultText="Submit" type="primary" buttonType="submit"}}
{{/bs-form}}

Authors

Simon Ihmig @ kaliber5

Copyright and license

Code and documentation copyright 2016 kaliber5 GmbH. Code released under the MIT license.

About

This Ember addon adds support for validations based on ember-validations to ember-bootstrap

Resources

License

Stars

Watchers

Forks

Packages

No packages published