| Index: tools/dom/templates/html/impl/impl_HTMLTemplateElement.darttemplate
|
| diff --git a/tools/dom/templates/html/impl/impl_HTMLTemplateElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLTemplateElement.darttemplate
|
| index eb3eb5152169a2b27ea425b28f42d581d534b1e0..6a1bd4a0d0297848910db77e7b0f1d7c3e10ad9d 100644
|
| --- a/tools/dom/templates/html/impl/impl_HTMLTemplateElement.darttemplate
|
| +++ b/tools/dom/templates/html/impl/impl_HTMLTemplateElement.darttemplate
|
| @@ -6,7 +6,6 @@
|
|
|
| part of $LIBRARYNAME;
|
|
|
| -
|
| /**
|
| * Model-Driven Views (MDV)'s native features enables a wide-range of use cases,
|
| * but (by design) don't attempt to implement a wide array of specialized
|
| @@ -15,32 +14,32 @@ part of $LIBRARYNAME;
|
| * Enabling these features in MDV is a matter of implementing and registering an
|
| * MDV Custom Syntax. A Custom Syntax is an object which contains one or more
|
| * delegation functions which implement specialized behavior. This object is
|
| - * registered with MDV via [TemplateElement.syntax]:
|
| + * registered with MDV via [Element.bindingDelegate]:
|
| *
|
| *
|
| * HTML:
|
| - * <template bind syntax="MySyntax">
|
| + * <template bind>
|
| * {{ What!Ever('crazy')->thing^^^I+Want(data) }}
|
| * </template>
|
| *
|
| * Dart:
|
| - * class MySyntax extends CustomBindingSyntax {
|
| + * class MySyntax extends BindingDelegate {
|
| * getBinding(model, path, name, node) {
|
| * // The magic happens here!
|
| * }
|
| * }
|
| - *
|
| * ...
|
| - *
|
| - * TemplateElement.syntax['MySyntax'] = new MySyntax();
|
| + * query('template').bindingDelegate = new MySyntax();
|
| + * query('template').model = new MyModel();
|
| *
|
| * See <https://github.com/polymer-project/mdv/blob/master/docs/syntax.md> for
|
| * more information about Custom Syntax.
|
| */
|
| -// TODO(jmesserly): if this is just one method, a function type would make it
|
| -// more Dart-friendly.
|
| +// TODO(jmesserly): move this type to the MDV package? Two issues: we'd lose
|
| +// type annotation on [Element.bindingDelegate], and "mdv" is normally imported
|
| +// with a prefix.
|
| @Experimental()
|
| -abstract class CustomBindingSyntax {
|
| +abstract class BindingDelegate {
|
| /**
|
| * This syntax method allows for a custom interpretation of the contents of
|
| * mustaches (`{{` ... `}}`).
|
| @@ -89,7 +88,6 @@ abstract class CustomBindingSyntax {
|
| getInstanceModel(Element template, model) => model;
|
| }
|
|
|
| -
|
| @Experimental()
|
| $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
|
| $!MEMBERS
|
| @@ -291,11 +289,4 @@ option[template] {
|
| }''';
|
| document.head.append(style);
|
| }
|
| -
|
| - /**
|
| - * A mapping of names to Custom Syntax objects. See [CustomBindingSyntax] for
|
| - * more information.
|
| - */
|
| - @Experimental()
|
| - static Map<String, CustomBindingSyntax> syntax = {};
|
| }
|
|
|