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

Side by Side Diff: test/data/input/recursive_component_test.html

Issue 12225039: Support for observable models, fixes #259 (Closed) Base URL: https://github.com/dart-lang/web-ui.git@master
Patch Set: Created 7 years, 10 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
« no previous file with comments | « test/data/input/radio_button_test.html ('k') | test/data/input/recursive_test_data.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <!-- 2 <!--
3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
4 for details. All rights reserved. Use of this source code is governed by a 4 for details. All rights reserved. Use of this source code is governed by a
5 BSD-style license that can be found in the LICENSE file. 5 BSD-style license that can be found in the LICENSE file.
6 --> 6 -->
7 <html lang="en"> 7 <html lang="en">
8 <head> 8 <head>
9 <script type='application/javascript' src="testing.js"></script> 9 <script type='application/javascript' src="testing.js"></script>
10 <style> div { padding: 10px; } </style> 10 <style> div { padding: 10px; } </style>
11 </head> 11 </head>
12 <body> 12 <body>
13 Expect nested divs 0 then 1. 13 Expect nested divs 0 then 1.
14 <element name='x-rec' extends="div"> 14 <element name='x-rec' extends="div">
15 <template> 15 <template>
16 {{check(pos)}} 16 {{check(pos)}}
17 <template if="pos < len"> 17 <template if="pos < len">
18 <div is="x-rec" pos="{{pos + 1}}"></div> 18 <div is="x-rec" pos="{{pos + 1}}"></div>
19 </template> 19 </template>
20 </template> 20 </template>
21 <script type='application/dart'> 21 <script type='application/dart'>
22 import 'package:web_ui/web_ui.dart'; 22 import 'package:web_ui/web_ui.dart';
23 import 'recursive_test_data.dart'; 23 import 'recursive_test_data.dart';
24 @observable
24 class Rec extends WebComponent { 25 class Rec extends WebComponent {
25 int pos; 26 int pos;
26 } 27 }
27 </script> 28 </script>
28 </element> 29 </element>
29 <div is="x-rec" pos="{{0}}"></div> 30 <div is="x-rec" pos="{{0}}"></div>
30 31
31 <script type="application/dart"> 32 <script type="application/dart">
32 import 'dart:html'; 33 import 'dart:html';
33 import 'package:web_ui/watcher.dart'; 34 import 'package:web_ui/observe.dart';
34 import 'recursive_test_data.dart'; 35 import 'recursive_test_data.dart';
35 36
36 main() { 37 main() {
37 window.setTimeout(() { 38 window.setTimeout(() {
38 dispatch();
39 window.setTimeout(() { 39 window.setTimeout(() {
40 len = 1; 40 len = 1;
41 dispatch();
42 window.setTimeout(() { 41 window.setTimeout(() {
43 len = 3; 42 len = 3;
44 dispatch();
45 window.setTimeout(() { 43 window.setTimeout(() {
46 len = 2; 44 len = 2;
47 dispatch();
48 window.setTimeout(() { 45 window.setTimeout(() {
49 len = 1; 46 len = 1;
50 dispatch(); 47 window.setImmediate(() => window.postMessage('done', '*'));
51 window.setTimeout(() => window.postMessage('done', '*'), 0);
52 }, 0); 48 }, 0);
53 }, 0); 49 }, 0);
54 }, 0); 50 }, 0);
55 }, 0); 51 }, 0);
56 }, 0); 52 }, 0);
57 } 53 }
58 </script> 54 </script>
59 </body> 55 </body>
60 </html> 56 </html>
61 57
OLDNEW
« no previous file with comments | « test/data/input/radio_button_test.html ('k') | test/data/input/recursive_test_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698