Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to list all the Bindings to an Ember.Object?

Example in coffeescript

window.APP = Ember.Application.create()

APP.stuff = Ember.Object.create(
  name: "The Name"
)

APP.things = Ember.Object.create(
  nameBinding: "APP.stuff.name"
)

APP.gizmos = Ember.Object.create(
  nameBinding: "APP.stuff.name"
)

Is there anyway to detect that APP.stuff has 2 bindings to its name property?

like image 269
InternalFX Avatar asked Sep 12 '12 18:09

InternalFX


1 Answers

I finally found the answer after digging through lots of source code....

I'm not sure the Devs recommend this approach....but it gives me what I want.

Basically the answer is to call...

Ember.meta(APP.stuff)

This returns an object that contains a "watching" hash, which contains the properties being watched and the number of watchers.

Ember is cool.

like image 112
InternalFX Avatar answered Oct 06 '22 19:10

InternalFX