Skip to content

Commit 6032993

Browse files
committed
Allow advanced platform bootstraps via AppOptions.
1 parent 8df4ef5 commit 6032993

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

nativescript-angular/platform.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import * as nativescriptIntl from "nativescript-intl";
5454
global.Intl = nativescriptIntl;
5555

5656
export interface AppOptions {
57+
bootInExistingPage: boolean,
5758
cssFile?: string;
5859
startPageActionBarHidden?: boolean;
5960
}
@@ -255,7 +256,12 @@ var _platformNativeScriptDynamic: PlatformFactory = createPlatformFactory(
255256
platformCoreDynamic, 'nativeScriptDynamic', NS_COMPILER_PROVIDERS);
256257

257258
export function platformNativeScriptDynamic(options?: AppOptions, extraProviders?: any[]): PlatformRef {
258-
return new NativeScriptPlatformRef(_platformNativeScriptDynamic(extraProviders), options);
259+
//Return raw platform to advanced users only if explicitly requested
260+
if (options && options.bootInExistingPage === true) {
261+
return _platformNativeScriptDynamic(extraProviders);
262+
} else {
263+
return new NativeScriptPlatformRef(_platformNativeScriptDynamic(extraProviders), options);
264+
}
259265
}
260266

261267
export const onBeforeLivesync = new EventEmitter<NgModuleRef<any>>();

0 commit comments

Comments
 (0)