В Angular2 у меня есть это:
<parent>
<child> // is injected from <parent>
<nephew> // is injected from <child>
<nephew> // is injected from <child>
<nephew> // is injected from <child>
<nephew> // is injected from <child>
<nephew>
имеет @Output, но он динамически вводится из <child>
, который динамически вводится из <parent>
Я сделал инъекции внутри <parent>
с createComponent
из ViewContainerRef
класс
@ViewChild('editfield', {read: ViewContainerRef}) editfield: ViewContainerRef;
this.componentFactoryResolver.resolveComponentFactory(DynamicFormComponent);
const ref = this.editfield.createComponent(factory, this.editfield.length, this.editfield.parentInjector, []);
В то время как <nephew>
являются списком компонентов из DynamicFormComponent , некоторые из которых являются пользовательскими
Я не знаю, как получить доступ к выводу <nephew>
, поскольку ref.instance
, который у меня есть на <parent>
, говорит о <child>
, а не <nephew>