OLD | NEW |
---|---|
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 <meta charset="utf-8"> | 9 <meta charset="utf-8"> |
10 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 10 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
11 <link rel="components" href="conditional4_component1.html"> | 11 <link rel="components" href="conditional4_component1.html"> |
12 <link rel="components" href="conditional4_component2.html"> | 12 <link rel="components" href="conditional4_component2.html"> |
13 <title></title> | |
14 <script type='application/javascript' src="testing.js"></script> | 13 <script type='application/javascript' src="testing.js"></script> |
15 </head> | 14 </head> |
16 <body> | 15 <body> |
17 <template if="cond"> | 16 <template if="cond"> |
18 <x-error></x-error> | 17 <x-error></x-error> |
19 </template> | 18 </template> |
20 <template if="notCond"> | 19 <template if="notCond"> |
21 <x-pass></x-pass> | 20 <x-pass></x-pass> |
22 </template> | 21 </template> |
23 <script type="application/dart"> | 22 <script type="application/dart"> |
24 import 'dart:html'; | 23 import 'dart:html'; |
25 import 'package:web_ui/watcher.dart'; | 24 import 'package:web_ui/observe.dart'; |
26 import 'common.dart'; | 25 import 'common.dart'; |
27 main() { | 26 main() { |
28 window.setTimeout(() { | 27 window.setTimeout(() { |
29 cond = true; | 28 cond = true; |
30 dispatch(); | 29 deliverChangesSync(); |
Siggi Cherem (dart-lang)
2013/02/13 19:28:54
are these needed? with setTimeout (or setImmediate
Jennifer Messerly
2013/02/14 00:38:09
Done.
| |
31 window.setTimeout(() { | 30 window.setTimeout(() { |
32 cond = false; | 31 cond = false; |
33 dispatch(); | 32 deliverChangesSync(); |
34 // in the end, we should see <x-pass> and not <x-error> | 33 // in the end, we should see <x-pass> and not <x-error> |
35 window.setTimeout(() => window.postMessage('done', '*'), 0); | 34 window.setImmediate(() => window.postMessage('done', '*')); |
36 }, 0); | 35 }, 0); |
37 }, 0); | 36 }, 0); |
38 } | 37 } |
39 </script> | 38 </script> |
40 </body> | 39 </body> |
41 </html> | 40 </html> |
OLD | NEW |