hopglass/lib/container.js
2017-03-18 16:26:29 +01:00

24 lines
348 B
JavaScript

define([], function () {
"use strict";
return function (tag) {
if (!tag) {
tag = "div";
}
var self = this;
var container = document.createElement(tag);
self.add = function (d) {
d.render(container);
};
self.render = function (el) {
el.appendChild(container);
};
return self;
};
});