vampolo
vampolo

Reputation: 107

In EmberJs is it possible to get Class object from an instance of the same Class?

Suppose you have

var A = Ember.Object.extend({});
A.reopenClass({
   myVariable: 'hello'
});

var a = A.create();

Is there a way from a to get the A object in order to get the myVariable value ?

Upvotes: 1

Views: 160

Answers (1)

jmurphyau
jmurphyau

Reputation: 2309

You can use a.constructor

a.constructor === A

a.constructor.myVariable === A.myVariable

Upvotes: 1

Related Questions