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

Unified Diff: pkg/polymer/lib/src/instance.dart

Issue 41383002: fix binding to $ from polymer templates (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | pkg/polymer/test/bind_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/lib/src/instance.dart
diff --git a/pkg/polymer/lib/src/instance.dart b/pkg/polymer/lib/src/instance.dart
index 8bb2a51b1d906030e47bc25c491fc43a132f6eeb..ed5d1fe17efffc0caf8f10164d7934db3246c231 100644
--- a/pkg/polymer/lib/src/instance.dart
+++ b/pkg/polymer/lib/src/instance.dart
@@ -104,8 +104,11 @@ abstract class Polymer implements Element, Observable, NodeBindExtension {
// * should we have an object that implements noSuchMethod?
// * should the map have a key order (e.g. LinkedHash or SplayTree)?
// * should this be a live list? Polymer doesn't, maybe due to JS limitations?
- // For now I picked the most performant choice: non-live HashMap.
- final Map<String, Element> $ = new HashMap<String, Element>();
+ // Note: this is observable to support $['someId'] being used in templates.
+ // The template is stamped before $ is populated, so we need observation if
+ // we want it to be usable in bindings.
+ @reflectable final Map<String, Element> $ =
+ new ObservableMap<String, Element>();
/**
* Gets the shadow root associated with the corresponding custom element.
« no previous file with comments | « no previous file | pkg/polymer/test/bind_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698