【发布时间】:2012-03-15 15:47:37
【问题描述】:
This question 展示了如何获取父视图的属性。
有没有办法实现与一般Ember.Objects 相同的效果。比如child如何访问App.Parent的属性:
App.Parent = Ember.Object.extend({
parentProperty: 'someValue',
child: App.Child.create()
});
App.Child = Ember.Object.extend({
init: function(){
// I don't know which is my parent object
// but I still want to access the value of `parentProperty`
// var parentProperty = ???
}
});
【问题讨论】:
标签: ember.js