Как прокинуть свойство через динамическое создание компонент?
Необходимо прокинуть свойство полученное из сервиса через динамическое создание компонент. Почему данная реализация не работает и как исправить? код компоненты:
private orgInfoTemplateRef: any;
ngOnInit(): void {
this.createOrganizationInfoComponent();
this.getOrgInfo();
}
createOrganizationInfoComponent(): void {
this.organizationInfoTemplate.clear();
const factory = this.resolver.resolveComponentFactory(MarketParticipantOrgInfoComponent);
this.orgInfoTemplateref = this.organizationInfoTemplate.createComponent(factory);
}
getOrganizationInfo(): void {
this.retailService.getOrganizationInfo(this.id)
.subscribe((res: any) => {
this.organizationInfo = res;
(<MarketParticipantOrgInfoComponent> this.orgInfoTemplateRef.instance).organizationInfo = orgInfo;
}