Skip to content

Commit 3cff830

Browse files
committed
fix: launchView handling
1 parent b3b715b commit 3cff830

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/angular/src/lib/application.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const onAfterLivesync: Observable<{
5959
export interface AppRunOptions<T, K> {
6060
appModuleBootstrap: (reason: NgModuleReason) => Promise<NgModuleRef<T>>;
6161
loadingModule?: (reason: NgModuleReason) => Promise<NgModuleRef<K>>;
62-
launchView?: (reason: NgModuleReason) => AppLaunchView;
62+
launchView?: (reason?: NgModuleReason) => AppLaunchView;
6363
}
6464

6565
if (module['hot']) {
@@ -276,7 +276,11 @@ export function runNativeScriptAngularApp<T, K>(options: AppRunOptions<T, K>) {
276276
mainModuleRef = null;
277277
};
278278
const launchCallback = profile('@nativescript/angular/platform-common.launchCallback', (args: LaunchEventData) => {
279-
args.root = null;
279+
if (options?.launchView) {
280+
args.root = options.launchView('applaunch');
281+
} else {
282+
args.root = null;
283+
}
280284
bootstrapRoot('applaunch');
281285
});
282286
const exitCallback = profile('@nativescript/angular/platform-common.exitCallback', (args: ApplicationEventData) => {

0 commit comments

Comments
 (0)