If I call Ember.inspect(component)
, I get a response like:
<app@component:my-component::ember1246>
This suggests that the component is aware of its own name (my-component
). Is there a way to access just that name?
Ember.inspect()
calls the objects toString()
which in turn calls some internal ember metal functions to derive the name.
There is however an internal property which people have been using to get the name:
this.__proto__._debugContainerKey
This outputs component:my-component
, then you can just split on :
. There's an issue which will create a public way of exposing object meta information which we'll be able to use in the future: https://github.com/emberjs/ember.js/issues/10742
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With