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

Unified Diff: lib/templating.dart

Issue 13592003: add support for template repeat (Closed) Base URL: https://github.com/dart-lang/web-ui.git@master
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: lib/templating.dart
diff --git a/lib/templating.dart b/lib/templating.dart
index b8cb7856c23cad7299c3807312fa403d70176a92..65b685fade0354cbc2c24378d42ad37524bd4c90 100644
--- a/lib/templating.dart
+++ b/lib/templating.dart
@@ -456,10 +456,16 @@ class Template extends TemplateItem {
}
/** Watch [exp] and render a loop while this template is visible. */
- void loop(Node template, exp, iterSetup, {isTemplateElement: true}) {
- children.add(
- isTemplateElement ? new LoopTemplate(template, exp, iterSetup)
- : new LoopTemplateInAttribute(template, exp, iterSetup));
+ void loop(Node template, exp, iterSetup) {
+ children.add(new LoopTemplate(template, exp, iterSetup));
+ }
+
+ /**
+ * Watch [exp] and render a loop while this template is visible.
+ * NOTE: this form is deprecated. Please use [loop] instead.
+ */
+ void loopIterateAttr(Node template, exp, iterSetup) {
Siggi Cherem (dart-lang) 2013/04/05 20:09:24 should we add @deprecated?
Jennifer Messerly 2013/04/05 20:34:36 :) yeah I had the same thought. My fear was that o
+ children.add(new LoopTemplateInAttribute(template, exp, iterSetup));
}
/** Bind the lifecycle of the component with this template's lifecycle. */
@@ -601,7 +607,10 @@ class ConditionalTemplate extends PlaceholderTemplate {
/** Function to set up the contents of a loop template. */
typedef void LoopIterationSetup(loopVariable, Template template);
-/** A template loop of the form `<template iterate="x in list ">`. */
+/**
+ * A template loop of the form `<template iterate="x in list ">` or
+ * `<td template repeat="x in list">`.
+ */
class LoopTemplate extends PlaceholderTemplate {
final LoopIterationSetup iterSetup;

Powered by Google App Engine
This is Rietveld 408576698