Reputation: 3213
Guys,
I am new to Emberjs, now trying Ember 1.0.0 out.
But I am confused that when I create a new View, and then append it to body
, and in didInsertElement
, view.element
returns undefined
which I expect to be an element.
I went a little bit into the source code, and try using view.currentState.getElement(view)
, and it returns the element correctly.
Why is that? Did I do something wrong?
Upvotes: 2
Views: 575
Reputation: 488
You have to get the element from this object like this,
didInsertElement: function() {
console.log(this.get('element')); //logs the element
}
Upvotes: 1