Skip to content
Bitcollage edited this page Dec 26, 2015 · 2 revisions
Instructions for using only in ES5 environment

(available at app-decorators >= v1.0)

  • This can be used at app-decorators >=0.3 however you have to transpile the code src/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
Description
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);
Clone this wiki locally