Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/nativescript-angular/view_node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ export class ViewNode {
} else {
parentLayout.addChild(this.nativeView);
}
} else if (this.parentNativeView instanceof ContentView) {
(<ContentView>this.parentNativeView).content = this.nativeView;
} else if ((<any>this.parentNativeView)._addChildFromBuilder) {
(<any>this.parentNativeView)._addChildFromBuilder(this.viewName, this.nativeView);
} else if (this.parentNode.isComplexProperty) {
Expand Down Expand Up @@ -334,10 +336,15 @@ export class ViewNode {
this.detachUIEvents();
if (this.nativeView) {
let nativeParent = this.nativeView.parent;
if (nativeParent instanceof LayoutBase) {
(<LayoutBase>nativeParent).removeChild(this.nativeView);
} else {
nativeParent._removeView(this.nativeView);
if (nativeParent) {
if (nativeParent instanceof LayoutBase) {
(<LayoutBase>nativeParent).removeChild(this.nativeView);
} else if (nativeParent instanceof ContentView) {
(<ContentView>nativeParent).content = undefined;
}
else {
nativeParent._removeView(this.nativeView);
}
}
}

Expand Down