feat(viewPort): adds initial implementation of ViewPort.

ViewPort is the mechanism backing @Template directives. Those
directives can use the viewport to dynamically create, attach and
detach views.
This commit is contained in:
Rado Kirov
2014-11-21 15:13:01 -08:00
parent 9a28fa8590
commit c6f14dd833
9 changed files with 403 additions and 30 deletions

View File

@ -47,6 +47,12 @@ class DOM {
static appendChild(el, node) {
el.append(node);
}
static removeChild(el, node) {
node.remove();
}
static insertAfter(el, node) {
el.parentNode.insertBefore(node, el.nextNode);
}
static setText(Text text, String value) {
text.text = value;
}

View File

@ -40,6 +40,12 @@ export class DOM {
static appendChild(el, node) {
el.appendChild(node);
}
static removeChild(el, node) {
el.removeChild(node);
}
static insertAfter(el, node) {
el.parentNode.insertBefore(node, el.nextSibling);
}
static setInnerHTML(el, value) {
el.innerHTML = value;
}