You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.
I encountered this very recently with a Map.
When you have a field
@observable
List myList = [];
// or even
// List myList = toObservable([]);
and add it to the template of your Polymer element like
{{myList}}
Id doesn't get updated when you add/remove/modify items in the List.
This is mostly because myList hasn't changed and this is what {{myList}} refers to. myList still refers the same list.
{{myList}} implicitely uses toString() but it seems toString() is not observed for changes. {{myList.toString()}} doesn't change this (at least this was the case for my Map example).
If you do something like
void addItem(Event e) {
myList.add('xxx');
var tmp = myList;
myList = null;
new Future(() => myList = tmp);
}
This has caused a lot of confusion and come up a few times, I might spend a bit of time today seeing if I can get it working correctly. This is really only useful as a debugging feature but I think that even if its just for that its worth getting right.
Originally opened as dart-lang/sdk#21568
This issue was originally filed by [email protected]
What steps will reproduce the problem?
What is the expected output? What do you see instead?
I should see the list updated (["new element"]), instead the list is not updated ("[]").
What version of the product are you using?
Dart 1.7.2, polymer-expression 0.13.0
Please provide any additional information below.
The text was updated successfully, but these errors were encountered: