我的 Angular 本机脚本应用程序一直存在这个问题,并且似乎无法继续使用在线建议的任何修复程序。
问题是:
View not added to this instance. View: ProxyViewContainer(315) CurrentParent: undefined ExpectedParent: ScrollView(198)
我们来看看持有组件的父组件:
全layout.component.tns.html
<RadSideDrawer tkExampleTitle tkToggleNavButton [drawerContentSize]="innerHeight" gesturesEnabled="false"
drawerLocation="Left" (drawerClosed)="onDrawerClosed()">
<page-router-outlet tkMainContent></page-router-outlet>
<GridLayout tkDrawerContent rows="auto, *" class="sideStackLayout">
<ScrollView row="1">
<component-one *ngIf="showComponentOne"></component-one>
<component-two *ngIf="showComponentTwo" (backEvent)="backToDefaultComponent()"></component-two>
</ScrollView>
</GridLayout>
这里发生的情况是,在 rad 侧抽屉内,使用真假条件显示和隐藏了多个组件,并将智利组件(组件一,组件二)的事件输出到父组件(完整布局)。在这个特定的组件 - 两个组件上,当使用相同的事件返回时,它会显示此错误。我不知道为什么其他组件可以在相同的布局结构和功能下正常工作。
编辑:我们调试了代码的每个元素并将其缩小到
private viewContainerRef: ViewContainerRef
在用于模态创建的构造函数中注入。如果您删除它,它会按预期工作。这是一个错误吗?
角度版本:8.2.14 NS 版本:6.7.8
Ps 我可以在我们可以亲自联系的地方分享我的代码吗?