Files
sdk/pkg/polymer_expressions/example/example.dart
T
sigmund@google.com 0417d48a78 Changes in polymer-expressions to prepare for codegen in polymer:
- change scopes to have either variable or model, but not both
 - change lookup to aggressively read from the model, and not use hasGetter
 - trap all errors (not just eval errors), so that rendering is smooth.
 - change error reporting to fire an async error. Now there is no need for
   using logger/registering the logger.
 - fix test in polymer that apparently was swalling an error in
   dart2js-minified. This fix wont be needed once we have codegen.

R=jmesserly@google.com

Review URL: https://codereview.chromium.org//207433002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34283 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-22 00:58:05 +00:00

26 lines
823 B
Dart

// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:html';
import 'package:polymer_expressions/polymer_expressions.dart';
import 'package:template_binding/template_binding.dart' show templateBind;
import 'person.dart';
main() {
var john = new Person('John', 'Messerly', ['A', 'B', 'C']);
var justin = new Person('Justin', 'Fagnani', ['D', 'E', 'F']);
var globals = {
'uppercase': (String v) => v.toUpperCase(),
'people': [john, justin],
};
templateBind(querySelector('#test'))
..bindingDelegate = new PolymerExpressions(globals: globals)
..model = john;
templateBind(querySelector('#test2')).model = john;
}