Skip to content

Add support for validations based on ember-changeset to ember-bootstrap forms

License

Notifications You must be signed in to change notification settings

ember-bootstrap/ember-bootstrap-changeset-validations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c13b1d2 · Mar 31, 2020

History

43 Commits
Mar 25, 2020
Dec 27, 2016
Mar 25, 2020
Feb 13, 2020
Jun 22, 2016
Feb 13, 2020
Jun 22, 2016
Mar 14, 2019
Feb 13, 2020
Mar 14, 2019
Feb 13, 2020
Feb 13, 2020
Mar 25, 2020
Jun 22, 2016
Mar 31, 2020
Mar 14, 2019
Feb 13, 2020
Mar 30, 2020
Mar 30, 2020
Feb 13, 2020
Mar 14, 2019
Mar 31, 2020
Feb 13, 2020
Mar 30, 2020

Repository files navigation

Ember-bootstrap-changeset-validations

Build Status

This Ember addon adds support for validations based on ember-changeset to ember-bootstrap forms. This way your forms are only submitted when the underlying data is valid, otherwise the appropriate bootstrap error markup will be applied. See the FormElement documentation for further details.

Compatibility

  • Ember Bootstrap v3
  • Ember Changeset and Ember Changeset Validations v3
  • Ember.js v3.16 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Installation

ember install ember-bootstrap-changeset-validations

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

ember install ember-bootstrap
ember install ember-changeset

You probably also want to install ember-changeset-validations if you do not have a custom validation implementation:

ember install ember-changeset-validations

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

ember install ember-bootstrap-changeset-validations@1.0.0-alpha

Usage

Define your model and its validations as described in ember-changeset-validations. Then assign the changeset based on that to your form:

{{#bs-form model=(changeset user userValidations)}}
    {{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

Contributing

See the Contributing guide for details.

Copyright and license

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