JSPM

  • Created
  • Published
  • Downloads 25690
  • Score
    100M100P100Q163894F
  • License BSD-3-Clause

Enables a custom element to be included in an iron-form

Package Exports

  • @polymer/iron-form-element-behavior
  • @polymer/iron-form-element-behavior/iron-form-element-behavior
  • @polymer/iron-form-element-behavior/iron-form-element-behavior.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@polymer/iron-form-element-behavior) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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);