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

Unified Diff: pkg/polymer/lib/auto_binding.dart

Issue 568463002: fix auto-binding-dart example (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: add note to example Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/auto_binding.dart
diff --git a/pkg/polymer/lib/auto_binding.dart b/pkg/polymer/lib/auto_binding.dart
index 1e1d0b69c14029d6939e92613a52c8c8c9dadfd5..522152da202d43068cdf2ed322882a1129d7e9e3 100644
--- a/pkg/polymer/lib/auto_binding.dart
+++ b/pkg/polymer/lib/auto_binding.dart
@@ -18,9 +18,15 @@ import 'package:template_binding/template_binding.dart';
* a model. It stamps its content in the dom adjacent to itself. When the
* content is stamped, the `template-bound` event is fired.
*
+ * **NOTE**: It is a good idea to use an id to select these elements. During
+ * code transformation it is likely that other template elements will be
+ * inserted at the top of the body above yours, so something like
+ * querySelector('template') is likely to break when built.
+ * See http://dartbug.com/20911.
+ *
* Example:
*
- * <template is="auto-binding-dart">
+ * <template id="my-template" is="auto-binding-dart">
* <div>Say something: <input value="{{value}}"></div>
* <div>You said: {{value}}</div>
* <button on-tap="{{buttonTap}}">Tap me!</button>
@@ -30,7 +36,7 @@ import 'package:template_binding/template_binding.dart';
* import 'package:polymer/polymer.dart';
*
* main() {
- * var template = document.querySelector('template');
+ * var template = document.querySelector('#my-template');
* template.model = new MyModel();
* }
*
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698