| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // WARNING: Do not edit - generated code. | 5 // WARNING: Do not edit - generated code. |
| 6 | 6 |
| 7 part of $LIBRARYNAME; | 7 part of $LIBRARYNAME; |
| 8 | 8 |
| 9 @Experimental | 9 @Experimental |
| 10 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 10 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 * By default [decorate] will be called on templates lazily when certain | 79 * By default [decorate] will be called on templates lazily when certain |
| 80 * properties such as [model] are accessed, but it can be run eagerly to | 80 * properties such as [model] are accessed, but it can be run eagerly to |
| 81 * decorate an entire tree recursively. | 81 * decorate an entire tree recursively. |
| 82 */ | 82 */ |
| 83 // TODO(rafaelw): Review whether this is the right public API. | 83 // TODO(rafaelw): Review whether this is the right public API. |
| 84 @Experimental | 84 @Experimental |
| 85 static void bootstrap(Node content) { | 85 static void bootstrap(Node content) { |
| 86 _Bindings._bootstrapTemplatesRecursivelyFrom(content); | 86 _Bindings._bootstrapTemplatesRecursivelyFrom(content); |
| 87 } | 87 } |
| 88 | 88 |
| 89 /** |
| 90 * Binds all mustaches recursively starting from the [root] node. |
| 91 * |
| 92 * Note: this is not an official Model-Driven-Views API; it is intended to |
| 93 * support binding the [ShadowRoot]'s content to a model. |
| 94 */ |
| 95 // TODO(jmesserly): this is needed to avoid two <template> nodes when using |
| 96 // bindings in a custom element's template. See also: |
| 97 // https://github.com/polymer-project/polymer/blob/master/src/bindMDV.js#L68 |
| 98 // Called from: |
| 99 // https://github.com/polymer-project/polymer/blob/master/src/register.js#L99 |
| 100 @Experimental |
| 101 static void bindModel(Node root, model, [CustomBindingSyntax syntax]) { |
| 102 _Bindings._addBindings(root, model, syntax); |
| 103 } |
| 104 |
| 89 static bool _initStyles; | 105 static bool _initStyles; |
| 90 | 106 |
| 91 static void _injectStylesheet() { | 107 static void _injectStylesheet() { |
| 92 if (_initStyles == true) return; | 108 if (_initStyles == true) return; |
| 93 _initStyles = true; | 109 _initStyles = true; |
| 94 | 110 |
| 95 var style = new StyleElement(); | 111 var style = new StyleElement(); |
| 96 style.text = r''' | 112 style.text = r''' |
| 97 template, | 113 template, |
| 98 thead[template], | 114 thead[template], |
| (...skipping 11 matching lines...) Expand all Loading... |
| 110 document.head.append(style); | 126 document.head.append(style); |
| 111 } | 127 } |
| 112 | 128 |
| 113 /** | 129 /** |
| 114 * A mapping of names to Custom Syntax objects. See [CustomBindingSyntax] for | 130 * A mapping of names to Custom Syntax objects. See [CustomBindingSyntax] for |
| 115 * more information. | 131 * more information. |
| 116 */ | 132 */ |
| 117 @Experimental | 133 @Experimental |
| 118 static Map<String, CustomBindingSyntax> syntax = {}; | 134 static Map<String, CustomBindingSyntax> syntax = {}; |
| 119 } | 135 } |
| OLD | NEW |