Int*_*lFX 6 javascript ember.js
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"
)
Run Code Online (Sandbox Code Playgroud)
反正有没有检测到APP.stuff有2个绑定到它的名称属性?
经过大量的源代码挖掘后,我终于找到了答案......
我不确定开发人员是否推荐这种方法......但它给了我我想要的。
基本上答案是打电话...
Ember.meta(APP.stuff)
Run Code Online (Sandbox Code Playgroud)
这将返回一个包含“监视”哈希的对象,其中包含正在监视的属性和监视者的数量。
余烬很酷。
| 归档时间: |
|
| 查看次数: |
98 次 |
| 最近记录: |