In the Polymer document (https://elements.polymer-project.org/elements/iron-input), I found:
<input is="iron-input" bind-value="{{myValue}}">
And in another official document (https://www.polymer-project.org/1.0/docs/devguide/registering-elements.html#type-extension) , I found:
<dom-module id="main-document-element">
<template>
<p>
Hi! I'm a Polymer element that was defined in the
main document!
</p>
</template>
<script>
HTMLImports.whenReady(function () {
Polymer({
is: 'main-document-element'
});
});
</script>
</dom-module>
<main-document-element></main-document-element>
I was just wondering why the first one <input is="iron-input" bind-value="{{myValue}}">
can't be written as <iron-input bind-value="{{myValue}}">
.
Is it for compatibility, which makes it easier to polyfill?
The iron-input
element does not contain any HTML in its source code. This means that doing:
<iron-input bind-value="{{myValue}}">
will not produce an actual input on the page for the user to interact with. The iron-input
element is really a collection of behaviours that you can apply to a standard HTML input.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With