моего понимания, то, как вы установили @Input переменные для компонента, добавленного к DOM с DynamicComponentLoader, является то, что вы используете блок обещания после вызова что-то вроде loadIntoLocation:Angular2 параметров dynamiccomponentloader для @output
this.dcl.loadIntoLocation(Lorem, this.elRef, 'target')
.then(cmpRef => {
cmpRef.instance.foo = _self.baz;
});
export class Lorem {
public @Input() foo : String;
...
Мои вопросы: как вы устанавливаете @Output при использовании dynamiccomponentloader?
this.dcl.loadIntoLocation(Lorem, this.elRef, 'target')
.then(cmpRef => {
cmpRef.instance.foo = _self.baz;
cmpRef.instance.changer = _self.change($event);
});
export class Lorem {
public @Input() foo : String;
@Output() changer = new EventEmitter();
...
...
this.changer.emit("event");
Я очень благодарен за помощь, которую вы могли бы предложить.
Компоненты, добавленные 'DynamicComponentLoader', не поддерживают' @Input() 'и' @Output() ' –