method createComputedProperties


dynamic createComputedProperties()

Source

createComputedProperties() {
  var computed = this.element._computed;
  for (var name in computed.keys) {
    try {
      // Dart note: this is done in Javascript by modifying the prototype in
      // declaration/properties.js, we can't do that, so we do it here.
      var binding = _getBindingForComputedProperty(name);

      // Follow up note: ideally we would only create the accessor object
      // here, but some computed properties might depend on others and
      // evaluating `binding.value` could try to read the value of another
      // computed property that we haven't created yet. For this reason we
      // also allow to also create the accessor in [readValue].
      if (_properties[name] == null) {
        _properties[name] = new _PropertyAccessor(name, this, binding.value);
      }
      bindToAccessor(name, binding);
    } catch (e) {
      window.console.error('Failed to create computed property $name'
          ' (${computed[name]}): $e');
    }
  }
}