Any method to access properties of parent objects in Ember?
This question shows how to get the properties of parent views.
Is there a way to achieve this with generic Ember.Object
s. For example, as accessor properties child
for 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 = ???
}
});
+3
source to share