Я хочу динамически загрузить пользовательский угловой компонент в nativeScript stackLayout в файле машинописного текста.Я пытаюсь это, но не работает:
createTabViewItems() {
this.tabs = [];
const stackLayout = new StackLayout();
let customCmp= this.cfr.resolveComponentFactory(CustomComponent);
let componentRef = this.container.createComponent(customCmp);
stackLayout.addChild(componentRef);
const tbi = new TabViewItem();
tbi.view = stackLayout;
this.tabs.push(tbi);
let tabView = new TabView();
tabView .items = this.tabs;
}
после этого я получил следующую ошибку: Аргумент типа 'ComponentRef' не может быть назначен параметру типа 'View'.
пожалуйстаПомоги мне!(