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

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

Issue 19663011: Custom Syntax's are now enabled via template.bindingDelegate = (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: restore @Experimental Created 7 years, 5 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
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 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 class _ChildrenElementList extends ListBase<Element> { 7 class _ChildrenElementList extends ListBase<Element> {
8 // Raw Element. 8 // Raw Element.
9 final Element _element; 9 final Element _element;
10 final HtmlCollection _childElements; 10 final HtmlCollection _childElements;
(...skipping 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 * Gets the content of this template. 855 * Gets the content of this template.
856 * This is only supported if [isTemplate] is true. 856 * This is only supported if [isTemplate] is true.
857 */ 857 */
858 @Experimental() 858 @Experimental()
859 DocumentFragment get content { 859 DocumentFragment get content {
860 _ensureTemplate(); 860 _ensureTemplate();
861 return _templateContent; 861 return _templateContent;
862 } 862 }
863 863
864 /** 864 /**
865 * Creates an instance of the template. 865 * Creates an instance of the template, using the provided model and binding
866 * delegate.
867 *
866 * This is only supported if [isTemplate] is true. 868 * This is only supported if [isTemplate] is true.
867 */ 869 */
868 @Experimental() 870 @Experimental()
869 DocumentFragment createInstance(model, String syntax) { 871 DocumentFragment createInstance(model, BindingDelegate delegate) {
870 _ensureTemplate(); 872 _ensureTemplate();
871 return TemplateElement.mdvPackage(this).createInstance(model, syntax); 873 return TemplateElement.mdvPackage(this).createInstance(model, delegate);
872 } 874 }
873 875
874 /** 876 /**
875 * The data model which is inherited through the tree. 877 * The data model which is inherited through the tree.
876 * This is only supported if [isTemplate] is true. 878 * This is only supported if [isTemplate] is true.
877 */ 879 */
878 @Experimental() 880 @Experimental()
879 get model => TemplateElement.mdvPackage(this).model; 881 get model => TemplateElement.mdvPackage(this).model;
880 882
881 @Experimental() 883 @Experimental()
882 void set model(value) { 884 void set model(value) {
883 _ensureTemplate(); 885 _ensureTemplate();
884 TemplateElement.mdvPackage(this).model = value; 886 TemplateElement.mdvPackage(this).model = value;
885 } 887 }
886 888
889 /**
890 * The binding delegate which is inherited through the tree. It can be used
891 * to configure custom syntax for `{{bindings}}` inside this template.
892 *
893 * This is only supported if [isTemplate] is true.
894 */
895 @Experimental()
896 BindingDelegate get bindingDelegate =>
897 TemplateElement.mdvPackage(this).bindingDelegate;
898
899 @Experimental()
900 void set bindingDelegate(BindingDelegate value) {
901 _ensureTemplate();
902 TemplateElement.mdvPackage(this).bindingDelegate = value;
903 }
904
887 // TODO(jmesserly): const set would be better 905 // TODO(jmesserly): const set would be better
888 static const _TABLE_TAGS = const { 906 static const _TABLE_TAGS = const {
889 'caption': null, 907 'caption': null,
890 'col': null, 908 'col': null,
891 'colgroup': null, 909 'colgroup': null,
892 'tbody': null, 910 'tbody': null,
893 'td': null, 911 'td': null,
894 'tfoot': null, 912 'tfoot': null,
895 'th': null, 913 'th': null,
896 'thead': null, 914 'thead': null,
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 const ScrollAlignment._internal(this._value); 1082 const ScrollAlignment._internal(this._value);
1065 toString() => 'ScrollAlignment.$_value'; 1083 toString() => 'ScrollAlignment.$_value';
1066 1084
1067 /// Attempt to align the element to the top of the scrollable area. 1085 /// Attempt to align the element to the top of the scrollable area.
1068 static const TOP = const ScrollAlignment._internal('TOP'); 1086 static const TOP = const ScrollAlignment._internal('TOP');
1069 /// Attempt to center the element in the scrollable area. 1087 /// Attempt to center the element in the scrollable area.
1070 static const CENTER = const ScrollAlignment._internal('CENTER'); 1088 static const CENTER = const ScrollAlignment._internal('CENTER');
1071 /// Attempt to align the element to the bottom of the scrollable area. 1089 /// Attempt to align the element to the bottom of the scrollable area.
1072 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1090 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1073 } 1091 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/templates/html/impl/impl_HTMLTemplateElement.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698