Closed lolmaus closed 2 years ago
Reproduction:
cd yuidork git checkout gen-1-1 bower i yarn ember s
Visit this URL: http://localhost:4200/#/emberjs/ember.js/master/modules/@ember*application
Then click Application in the Classes section in the leftmost menu. The app will crash because it tries to access a property on this.$() from didInsertParent, but this.$() returns undefined.
Application
Classes
this.$()
didInsertParent
undefined
The cause of the problem is visible in the debugger:
Child mixin calls initChild on init.
initChild
init
https://github.com/miguelcobain/ember-composability-tools/blob/v0.0.9/addon/mixins/child.js#L17
Child's initChild calls registerWithParent.
registerWithParent
https://github.com/miguelcobain/ember-composability-tools/blob/v0.0.9/addon/mixins/child.js#L21
Child's registerWithParent calls registerChild on parent.
registerChild
https://github.com/miguelcobain/ember-composability-tools/blob/v0.0.9/addon/mixins/child.js#L54
Parent's registerChild calls didInsertParent on child.
https://github.com/miguelcobain/ember-composability-tools/blob/v0.0.9/addon/mixins/parent.js#L77
Since this all started on child's init, child's element and $() are unavailable.
element
$()
@lolmaus Does #11 fix this for you? I have a feeling it might.
Closed due to https://github.com/miguelcobain/ember-composability-tools/pull/11#issuecomment-943963569
Reproduction:
Visit this URL: http://localhost:4200/#/emberjs/ember.js/master/modules/@ember*application
Then click
Application
in theClasses
section in the leftmost menu. The app will crash because it tries to access a property onthis.$()
fromdidInsertParent
, butthis.$()
returnsundefined
.The cause of the problem is visible in the debugger:
Child mixin calls
initChild
oninit
.https://github.com/miguelcobain/ember-composability-tools/blob/v0.0.9/addon/mixins/child.js#L17
Child's
initChild
callsregisterWithParent
.https://github.com/miguelcobain/ember-composability-tools/blob/v0.0.9/addon/mixins/child.js#L21
Child's
registerWithParent
callsregisterChild
on parent.https://github.com/miguelcobain/ember-composability-tools/blob/v0.0.9/addon/mixins/child.js#L54
Parent's
registerChild
callsdidInsertParent
on child.https://github.com/miguelcobain/ember-composability-tools/blob/v0.0.9/addon/mixins/parent.js#L77
Since this all started on child's
init
, child'selement
and$()
are unavailable.