feat(dart/transform): Use the render Compiler and the DirectiveParser

Update the `TemplateCompile` step to use the full render `Compiler`.

Provide `DirectiveMetadata` for `ViewDefinition` objects and use it to
run the `DirectiveParser` step of the render compile pipeline.
This commit is contained in:
Tim Blasi
2015-05-05 10:31:21 -07:00
committed by Misko Hevery
parent 401c9efad7
commit 44f829dbc6
24 changed files with 576 additions and 93 deletions

View File

@ -83,7 +83,16 @@ class Html5LibDomAdapter implements DomAdapter {
throw 'not implemented';
}
String nodeName(node) {
throw 'not implemented';
switch (node.nodeType) {
case Node.ELEMENT_NODE:
return (node as Element).localName;
case Node.TEXT_NODE:
return '#text';
default:
throw 'not implemented for type ${node.nodeType}. '
'See http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1950641247'
' for node types definitions.';
}
}
String nodeValue(node) => node.data;
String type(node) {
@ -179,9 +188,8 @@ class Html5LibDomAdapter implements DomAdapter {
getElementsByTagName(element, String name) {
throw 'not implemented';
}
List classList(element) {
throw 'not implemented';
}
List classList(element) => element.classes.toList();
addClass(element, String classname) {
element.classes.add(classname);
}