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

Side by Side Diff: packages/polymer_expressions/example/example.dart

Issue 2312183003: Removed Polymer from Observatory deps (Closed)
Patch Set: Created 4 years, 3 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
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:html';
6
7 import 'package:polymer_expressions/polymer_expressions.dart';
8 import 'package:template_binding/template_binding.dart' show templateBind;
9
10 // We use mirrors for illustration purposes, but ideally we would generate a
11 // static configuration with smoke/static.dart.
12 import 'package:smoke/mirrors.dart';
13
14 // Since we use smoke/mirrors, we need to preserve symbols used in the template.
15 // This includes String.startsWith, List.take, and Person.
16 @MirrorsUsed(targets: const [String, List, Person])
17 import 'dart:mirrors';
18
19 import 'person.dart';
20
21 main() {
22 useMirrors();
23 var john = new Person('John', 'Messerly', ['A', 'B', 'C']);
24 var justin = new Person('Justin', 'Fagnani', ['D', 'E', 'F']);
25 var globals = {
26 'uppercase': (String v) => v.toUpperCase(),
27 'people': [john, justin],
28 };
29
30 templateBind(querySelector('#test'))
31 ..bindingDelegate = new PolymerExpressions(globals: globals)
32 ..model = john;
33
34 templateBind(querySelector('#test2')).model = john;
35 }
OLDNEW
« no previous file with comments | « packages/polymer_expressions/codereview.settings ('k') | packages/polymer_expressions/example/example.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698