Open jinyoung opened 7 years ago
but we have to implement these metaworks-specific features:
Inheritance - https://pascalprecht.github.io/2014/07/14/inheritance-and-composition-with-polymer/
<polymer-element name="icon-button" extends="basic-button">
<template>
<span>
<i class="icon"></i><shadow></shadow>
</span>
</template>
<script>
Polymer('icon-button', {
ready: function () {
// gets called once component is ready
console.log('icon-button ready');
// call parent `ready` handler
this.super();
}
});
</script>
</polymer-element>
[Note] 'polymer-element' has been changed to 'dom-module'
Anatomy of Polymer
#polymer-micro.html
window.Polymer = function (prototype) {
if (typeof prototype === 'function') {
prototype = prototype.prototype;
}
if (!prototype) {
prototype = {};
}
prototype = desugar(prototype);
var customCtor = prototype === prototype.constructor.prototype ? prototype.constructor : null;
var options = { prototype: prototype };
if (prototype.extends) {
options.extends = prototype.extends;
}
Polymer.telemetry._registrate(prototype);
var ctor = document.registerElement(prototype.is, options);
return customCtor || ctor;
};
How to find DOM elements which are specific Java class -
document.querySelector("class.name")
if user omits the java attribute, the id will be used as the java classname:
or, by the extended Polymer from metaworks, you only need to mark the module as metaworks, <— this looks best!
or
By using Polymer, metaworks doesn’t need to manage: