Reputation: 4048
Is it possible to inlude polymer elements using HTML attributes instead of HTML tags? For example:
<div some-polymer-behavior></div>
I think it is more convenient to use attributes than wrapping code into HTML tags if I want to decorate an existing element with some functionality.
Upvotes: 0
Views: 50
Reputation: 3662
What you are looking for is extending native HTML elements.
Your element is
Polymer({
is: 'my-div-extension',
extends: 'div'
});
And the usage is
<div is="my-div-extension"></div>
Unfortunately, this comes with a few drawbacks, which you should be aware of:
<div behavior-one behavior-two>
Upvotes: 2