Behavior that enables an element to be included in an iron-form

Published on NPM Build status Published on webcomponents.org

IronFormElementBehavior

IronFormElementBehavior adds a name, value and required properties to a custom element. This element is deprecated, and only exists for back compatibility with Polymer 1.x (where iron-form was a type extension), and it is not something you want to use. No contributions or fixes will be accepted.

See: Documentation.

Usage

Installation

npm install --save @polymer/iron-form-element-behavior

In a Polymer 3 element

import {PolymerElement, html} from '@polymer/polymer';
import {mixinBehaviors} from '@polymer/polymer/lib/legacy/class.js';
import {IronFormElementBehavior} from '@polymer/iron-form-element-behavior/iron-form-element-behavior.js';

class SampleElement extends mixinBehaviors([IronFormElementBehavior], PolymerElement) {
  static get template() {
    return html`
      <style>
        :host {
          display: block;
        }
      </style>
      <input name="[[name]]" value="{{value}}">
    `;
  }
}
customElements.define('sample-element', SampleElement);

Install

Link to this version
ImportedReleased 14 September 2018BSD 3-clause "New" or "Revised" License
Framework Support
Polymer 3.0+
Also supported:
Polymer 1 (1.0.7)Polymer 2 (2.1.3)
Browser Independent
Install with
npm install @polymer/iron-form-element-behavior"@3.0.1"
Run the above npm command in your project folder. If you have any issues installing, please contact the author.
Release notes - Version 3.0.1

Dependencies

  • @polymer/polymer#^3.0.0