Matt B
Matt B

Reputation: 6312

Where to bind observable getters in Polymer

In Polymer.dart I'm aware that there are no strictly observable getters, and that instead we need to use bindProperty() (Soon to be onPropertyChange()) and notifyProperty() to simulate the same thing.

Looking through various code samples, I see some locations where this is added in to the constructor of the PolymerElement's class, and others where the binding happens in the created() method. Is there a preference as to where binding should occur? Are there any significant benefits or detriments on putting them in one of these areas or another?

Upvotes: 3

Views: 433

Answers (1)

Seth Ladd
Seth Ladd

Reputation: 120799

Putting bindProperty into the constructor no longer works in polymer.dart >= 0.8. I am in the process of changing all my samples.

I am now using created as the location where I put my onPropertyChange or similar calls.

Upvotes: 1

Related Questions