Creating properties/bindings on the fly

I don’t fully understand the bindings API and what it can do. I’m looking at how Addepar’s StyleBindingsMixin sets up bindings on init, but is it possible to override the unknownProperty function of an observable, and add new properties when they are first requested, while allowing the requester to bind immediately to the new property for any updates?

E.g. in a controller definition,

needs: ['dynamicProperties'],
myPropBinding: 'controllers.dynamicProperties.someNewProperty'

whereby myProp will be bound to a newly generated someNewProperty in the other controller.

I’ve been fiddling. If I can get this to work as expected, it opens some exciting possibilities.

Thanks to your expert eyes!

Further fiddling and I answered my own question. It works. A new property can be defined within unknownProperty and bindings/observers will track changes:


1 Like