Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1004)

Side by Side Diff: tools/dom/templates/html/impl/impl_HTMLTemplateElement.darttemplate

Issue 14812016: expose MDV addBindings (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/dom/templates/html/impl/impl_Element.darttemplate ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tools/dom/templates/html/impl/impl_Element.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698