forked from NativeScript/nativescript-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatform-static.ts
More file actions
22 lines (19 loc) · 796 Bytes
/
platform-static.ts
File metadata and controls
22 lines (19 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Always import platform-common first - because polyfills
import {
NativeScriptPlatformRef,
AppOptions,
COMMON_PROVIDERS,
PlatformFactory
} from "./platform-common";
import { platformCore, PlatformRef, createPlatformFactory } from "@angular/core";
// "Static" platform
const _platformNativeScript: PlatformFactory = createPlatformFactory(
platformCore, "nativeScript", [...COMMON_PROVIDERS]);
export function platformNativeScript(options?: AppOptions, extraProviders?: any[]): PlatformRef {
// Return raw platform to advanced users only if explicitly requested
if (options && options.bootInExistingPage === true) {
return _platformNativeScript(extraProviders);
} else {
return new NativeScriptPlatformRef(_platformNativeScript(extraProviders), options);
}
}