Skip to content

Commit fe96c5c

Browse files
ADjenkovADjenkov
ADjenkov
authored and
ADjenkov
committed
chore(app-host-view): remove unnecessary extractContentFromHost method
1 parent b28938e commit fe96c5c

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

Diff for: nativescript-angular/app-host-view.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ export class AppHostView extends ContentView {
2626
}
2727

2828
this._content = value;
29-
this._content.parentNode = this;
29+
30+
if (value) {
31+
this._content.parentNode = this;
32+
}
3033

3134
this.ngAppRoot = value;
3235

Diff for: nativescript-angular/platform-common.ts

+2-10
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export class NativeScriptPlatformRef extends PlatformRef {
172172
bootstrapLog(`Angular bootstrap bootstrap done. uptime: ${uptime()}`);
173173

174174
if (!autoCreateFrame) {
175-
rootContent = this.extractContentFromHost(tempAppHostView);
175+
rootContent = tempAppHostView.content;
176176
}
177177

178178
lastBootstrappedModule = new WeakRef(moduleRef);
@@ -233,7 +233,7 @@ export class NativeScriptPlatformRef extends PlatformRef {
233233
onAfterLivesync.next({ moduleRef });
234234

235235
if (!autoCreateFrame) {
236-
rootContent = this.extractContentFromHost(tempAppHostView);
236+
rootContent = tempAppHostView.content;
237237
}
238238

239239
lastBootstrappedModule = new WeakRef(moduleRef);
@@ -282,12 +282,4 @@ export class NativeScriptPlatformRef extends PlatformRef {
282282
frame.navigate({ create: () => { return page; } });
283283
return { page, frame };
284284
}
285-
286-
private extractContentFromHost(tempAppHostView: AppHostView) {
287-
const result = tempAppHostView.content;
288-
tempAppHostView.content = null;
289-
tempAppHostView.ngAppRoot = result;
290-
result.parentNode = tempAppHostView;
291-
return result;
292-
}
293285
}

0 commit comments

Comments
 (0)