How to access members of the class used to create () an object in Ember?

I want to access the class used to instantiate an object from EmberJS. For example, given the example instance of MyWidgetClass in the example below, I would like to access the myProperty attribute of this class.

MyWidgetClass = Ember.View.Extend({});
MyWidgetClass.reopenClass({
  myProperty: 'hihihi'
});
console.log("The myProperty of MyWidgetClass is ", MyWidgetClass.myProperty);

myWidget = MyWidgetClass.create({});
console.log("The myProperty of the Class of myWidget is ",
    myWidget.WHAT_GOES_HERE.myProperty);

I want to know what to put WHAT_GOES_HERE in the last line of code. I tried myWidget._super, myWidget. Proto etc.

+3
source share
2 answers

You can use the property constructor. Here's jsFiddle: http://jsfiddle.net/7eJ79/

+3
source

You tried

myWidget.get('myProperty');

-1
source

All Articles