Peter
Peter

Reputation: 1710

Polymer.dart <property>Changed Functionality Not Working With Map

I am building a Dart app using Polymer.dart. I have a map in my polymer element as follows:

@observable Map theData = toObservable({
  'name':   '',
  'phone':  '',
  'email':  ''
});

...and have the following method set up:

theDataChanged() {
  // ...
}

However, theDataChanged() function is not called after the following operations are made:

theData['name'] = 'test1';
theData.putIfAbsent('new', () => 'test2');

Are the <property>Changed() methods not supported for Maps?

Upvotes: 4

Views: 157

Answers (1)

G&#252;nter Z&#246;chbauer
G&#252;nter Z&#246;chbauer

Reputation: 657058

There is an open bug and a workaround

toObservable() does not work correctly with a Map and template repeat

Upvotes: 2

Related Questions