-
Notifications
You must be signed in to change notification settings - Fork 2
custom element es5
Bitcollage edited this page Dec 26, 2015
·
2 revisions
(available at app-decorators >= v1.0)
- This can be used at
app-decorators >=0.3
however you have to transpile the codesrc/libs/customelement.js
by your self in the shell
babel src/libs/customelement.js --out-file dist/component.js --modules common --stage 0
make build module=amd // for using with requirejs
// or
make build module=common // for using with node
var CustomElement = require('src/libs/customelement');
function Item(){}
Item.prototype.a = function(){};
Item.prototype.b = function(){};
Item.prototype.c = function(){};
Item.prototype.created = function() {}
Item.prototype.attached = function() {}
Item.prototype.attributeChanged = function(attrName, oldVal, newVal) {}
Item.prototype.detached = function() {}
CustomElement.register(Item, HTMLElement);
var item = Item.create();
document.body.appendChild(item);