传递给子组件时动态组件不呈现

时间:2017-03-20 18:58:16

标签: ember.js ember-cli emblem.js

我正在尝试将组件构造函数传递给子组件,但是当我这样做时,我收到一条错误消息: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

奇怪的是,如果我延迟parent.group调用,一切正常。例如:

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

isShowingFormSection更改为true时,parent.group会被调用并呈现正常。

这是否意味着模板在组件准备好之前尝试实例化组件?

0 个答案:

没有答案