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

Side by Side Diff: test/data/input/component_field_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
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 <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">
(...skipping 19 matching lines...) Expand all
30 <template iterate="g in greetings"> 30 <template iterate="g in greetings">
31 <template iterate="n in names"> 31 <template iterate="n in names">
32 <template iterate="e in endings"> 32 <template iterate="e in endings">
33 <x-greeter greet-ing="{{g}}" title="{{n}}" ending="{{e}}"></x-greeter> 33 <x-greeter greet-ing="{{g}}" title="{{n}}" ending="{{e}}"></x-greeter>
34 </template> 34 </template>
35 </template> 35 </template>
36 </template> 36 </template>
37 <script type="application/dart"> 37 <script type="application/dart">
38 import 'dart:html'; 38 import 'dart:html';
39 import 'package:unittest/unittest.dart'; 39 import 'package:unittest/unittest.dart';
40 import 'package:web_ui/observe.dart';
40 41
41 var greetings = ['hello', 'hi']; 42 @observable
42 var names = ['world', 'universe']; 43 var greetings = toObservable(['hello', 'hi']);
43 var endings = ['??', '!!']; 44
45 @observable
46 var names = toObservable(['world', 'universe']);
47
48 @observable
49 var endings = toObservable(['??', '!!']);
50
44 main() { 51 main() {
45 window.setTimeout(() { 52 window.setTimeout(() {
46 expect(query('x-greeter').attributes, { 'title': 'world' }); 53 expect(query('x-greeter').attributes, { 'title': 'world' });
47 window.postMessage('done', '*'); 54 window.postMessage('done', '*');
48 }, 0); 55 }, 0);
49 } 56 }
50 </script> 57 </script>
51 </body> 58 </body>
52 </html> 59 </html>
OLDNEW
« no previous file with comments | « test/data/input/component_field_2way_test.html ('k') | test/data/input/component_imports_component2_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698