Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@particle/ember-easy-form-extensions

Package Overview
Dependencies
Maintainers
29
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@particle/ember-easy-form-extensions

Enhances Ember EasyForm by providing easy action handling, validations, and Ember 1.13 support for your forms

latest
Source
npmnpm
Version
1.0.15
Version published
Maintainers
29
Created
Source

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.

Keywords

ember-addon

FAQs

Package last updated on 23 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts