I have been having this issue with my angular native script app for a while now and cannot seem to move forward with any of the fixes suggested online.
The issue is:
View not added to this instance. View: ProxyViewContainer(315) CurrentParent: undefined ExpectedParent: ScrollView(198)
Let's look at the parent component that holds the components:
full-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>
Here what is happening is that inside the rad side drawer there are multiple components displayed and hid using true false conditions and output events from the chile components(component-one, component-two) to the parent(full-layout) component. On this particular component-two component, when going back using the same event it displays this error. I have no idea why as other components are working fine with the same layout structure and functionality.
EDIT: We debugged with each element of the code and narrowed it down to the
private viewContainerRef: ViewContainerRef
injection in the constructer used for modal creation. If you remove this it works as expected. Is this a bug?
Angular version: 8.2.14 NS version: 6.7.8
P.s I can share my code somewhere we can get in touch personally maybe?