iron-form-element-behavior
Behavior that enables an element to be included in an iron-form
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);
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Dependencies
- @polymer/polymer#^3.0.0
- Released
- 2018-09-14
- Maturity
- IMPORTED
- License
- BSD 3-clause "New" or "Revised" License
Compatibility
- Framework
- Polymer 3.0+
- Polymer 2.0+ in 2.1.3
- Polymer 1.0+ in 1.0.7
- Browser
- Browser Independent
iron-form-element-behavior - Vaadin Add-on Directory
Behavior that enables an element to be included in an iron-form[![Published on NPM](https://img.shields.io/npm/v/@polymer/iron-form-element-behavior.svg)](https://www.npmjs.com/package/@polymer/iron-form-element-behavior)
[![Build status](https://travis-ci.org/PolymerElements/iron-form-element-behavior.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-form-element-behavior)
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://webcomponents.org/element/@polymer/iron-form-element-behavior)
## 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](https://www.webcomponents.org/element/@polymer/iron-form-element-behavior).
## Usage
### Installation
```
npm install --save @polymer/iron-form-element-behavior
```
### In a Polymer 3 element
```js
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`
`;
}
}
customElements.define('sample-element', SampleElement);
```