Index: third_party/pkg/angular/example/web/animation/repeat_demo.dart |
diff --git a/third_party/pkg/angular/example/web/animation/repeat_demo.dart b/third_party/pkg/angular/example/web/animation/repeat_demo.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5857d72fe808751d9f480356f0b0afbeb0d781ba |
--- /dev/null |
+++ b/third_party/pkg/angular/example/web/animation/repeat_demo.dart |
@@ -0,0 +1,32 @@ |
+part of animation; |
+ |
+@Component( |
+ selector: 'repeat-demo', |
+ template: ''' |
+ <div class="repeat-demo"> |
+ <button ng-click="ctrl.addItem()">Add Thing</button> |
+ <button ng-click="ctrl.removeItem()">Remove Thing |
+ </button> |
+ <ul> |
+ <li ng-repeat="outer in ctrl.items"> |
+ <ul> |
+ <li ng-repeat="inner in ctrl.items">{{inner}}</li> |
+ </ul> |
+ </li> |
+ </ul> |
+ </div> |
+ ''', |
+ publishAs: 'ctrl', |
+ applyAuthorStyles: true) |
+class RepeatDemo { |
+ var thing = 0; |
+ final items = []; |
+ |
+ void addItem() { |
+ items.add("Thing ${thing++}"); |
+ } |
+ |
+ void removeItem() { |
+ if (items.isNotEmpty) items.removeLast(); |
+ } |
+} |