0

I am trying to pass in a component constructor to a child component, but when I do I get an error message: Assertion Failed: A helper named 'parent.section' could not be found

//parent-form.js
form-component as |f|
  ...
  child-component f=f

//child-component.js
f.group as |g|
  ...

//form-component.js
with (hash group=(component 'form-section-component')) as |h|
  yield h

The strange thing is if I delay the parent.group call everything works fine. For example:

//child-component.js
if isShowingFormSection
  f.group as |g|
    ...

When isShowingFormSection changes to true, parent.group gets called and renders just fine.

Does this mean the template is trying to instantiate the component before the component is ready?

dmoss18
  • 867
  • 1
  • 12
  • 25
  • form-component.js is not yielding anything to parent component something like `yield (hash group=(component 'form-section-component')` should be done right? – Ember Freak Mar 20 '17 at 19:03
  • Yeah that's how it is in the code I just forgot to put it in the post. Updated the post now. – dmoss18 Mar 20 '17 at 19:06
  • @dmoss18 can you check the following [twiddle](https://ember-twiddle.com/08809703ba1e54d3b6bdd5781ee644f5?openFiles=templates.components.child-component.hbs%2Ctemplates.components.form-component.hbs). I have tried to implement what I understood from your description; and it works as expected. I guess I am missing something, can you describe your case via modifying the twiddle further? – feanor07 Mar 21 '17 at 05:44

0 Answers0