@particle/ember-easy-form-extensions

1.0.15 • Public • Published

Ember Easy Form Extensions Build Status

This Ember addon enhances Ember EasyForm by providing easy action handling, validations, and Ember 1.13 support for your forms

To support Ember 1.13 Easy Form has been temporarily rewritten for Ember CLI. When EasyForm is updated by Dockyard this addon will support that instead of our own form components.

Ember apps running 1.12 or below may behave unexpectedly.

Installation

Uninstall any references to ember-easy-form and ember-validationsand then:

ember install ember-easy-form-extensions

Overview and Example

ember-easy-form-extensions comes prepackaged with ember-easy-form and ember-validations so you can now build awesome forms and handle the subsequent submission events just as easily as Easy Form makes writing your templates.

Here's an example:

{{!--app-name/templates/posts/new.hbs--}}

{{#form-wrapper}}
  {{#form-controls legend='Write a new post'}}

    {{!--model.title--}}
    {{input-group property='title'}}

    {{!--model.description--}}
    {{input-group property='description' type='textarea'}}

  {{/form-controls}}

  {{!--Submit and cancel buttons--}}
  {{form-submission}}
{{/form-wrapper}}
// app-name/controllers/posts/new.js

import Ember from 'ember';
import FormMixin from 'ember-easy-form-extensions/mixins/controllers/form';

export default Ember.Controller.extend(
  FormMixin, {

  validations: {
    'model.title': {
      presence: true
    }
  }

  /* Runs if cancel button in {{form-submission}} is clicked */

  cancel: function() {
    this.transitionTo('posts');
  },

  /* Runs after validations pass and submit button in {{form-submission}} is clicked */

  save: function() {
    this.get('content').save().then(function(post) {
      this.transitionTo('post', post);
    });
  },

});

Documentation

A walkthrough and documentation can be found in the wiki.

Package Sidebar

Install

npm i @particle/ember-easy-form-extensions

Weekly Downloads

6

Version

1.0.15

License

MIT

Unpacked Size

33.3 kB

Total Files

57

Last publish

Collaborators

  • jackson-particle
  • mike.grundy.npm
  • mohitparticle
  • eugene_particle
  • kmok23
  • karlag
  • cole-abbeduto-particle
  • pedrosordo
  • guohui
  • sbrust
  • particlebot
  • no1089
  • carlos.hdez
  • keeramis5
  • monkbroc
  • suda
  • mstan
  • sergeuz
  • debbie23
  • avtolstoy
  • mlauer
  • wraithan
  • azenk
  • bwalach
  • parteberseth
  • rickkas7
  • mrlambchop_particle
  • hugo.montero
  • mphsi