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

Unified Diff: pkg/polymer_expressions/lib/eval.dart

Issue 308563002: Fix polymer_expression binding bug with observable list (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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_expressions/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer_expressions/lib/eval.dart
diff --git a/pkg/polymer_expressions/lib/eval.dart b/pkg/polymer_expressions/lib/eval.dart
index c33a262ad510831dbd9f5b56dc0c55a8bc8f18a4..a33abeb126709838ae4ed21109cce2528924f15c 100644
--- a/pkg/polymer_expressions/lib/eval.dart
+++ b/pkg/polymer_expressions/lib/eval.dart
@@ -650,7 +650,12 @@ class IndexObserver extends ExpressionObserver<Index> implements Index {
var key = argument._value;
_value = receiverValue[key];
- if (receiverValue is Observable) {
+ if (receiverValue is ObservableList) {
+ _subscription = (receiverValue as ObservableList).listChanges
+ .listen((changes) {
+ if (changes.any((c) => c.indexChanged(key))) _invalidate(scope);
+ });
+ } else if (receiverValue is Observable) {
_subscription = (receiverValue as Observable).changes.listen((changes) {
if (changes.any((c) => c is MapChangeRecord && c.key == key)) {
_invalidate(scope);
« no previous file with comments | « no previous file | pkg/polymer_expressions/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698