FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
nativescript-angular/nativescript-angular/platform.ts at master · interneuron/nativescript-angular · GitHub
interneuron
/
nativescript-angular
Public
forked from
NativeScript/nativescript-angular
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
nativescript-angular
/
nativescript-angular
/
platform.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
78 lines (67 loc) · 2.33 KB
Breadcrumbs
nativescript-angular
/
nativescript-angular
/
platform.ts
Copy path
File metadata and controls
78 lines (67 loc) · 2.33 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Always import platform-common first - because polyfills
import
{
NativeScriptPlatformRef
,
AppOptions
,
PlatformFactory
,
COMMON_PROVIDERS
}
from
"./platform-common"
;
import
{
NSFileSystem
}
from
"./file-system/ns-file-system"
;
import
{
ElementSchemaRegistry
,
ResourceLoader
,
}
from
"@angular/compiler"
;
import
{
ɵplatformCoreDynamic
as
platformCoreDynamic
}
from
"@angular/platform-browser-dynamic"
;
import
{
ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS
as
INTERNAL_BROWSER_PLATFORM_PROVIDERS
}
from
"@angular/platform-browser"
;
import
{
COMPILER_OPTIONS
,
PlatformRef
,
InjectionToken
,
ViewEncapsulation
,
createPlatformFactory
,
MissingTranslationStrategy
,
StaticProvider
,
}
from
"@angular/core"
;
// Work around a TS bug requiring an imports of
// InjectionToken, ViewEncapsulation and MissingTranslationStrategy
// without using them
if
(
(
<
any
>
global
)
.
___TS_UNUSED
)
{
(
(
)
=>
InjectionToken
)
(
)
;
(
(
)
=>
ViewEncapsulation
)
(
)
;
(
(
)
=>
MissingTranslationStrategy
)
(
)
;
}
// Register DOM adapter, if possible. Dynamic platform only!
import
"./dom-adapter"
;
import
{
NativeScriptElementSchemaRegistry
}
from
"./schema-registry"
;
import
{
FileSystemResourceLoader
}
from
"./resource-loader"
;
export
const
NS_COMPILER_PROVIDERS
:
StaticProvider
[
]
=
[
INTERNAL_BROWSER_PLATFORM_PROVIDERS
,
{
provide
:
COMPILER_OPTIONS
,
useValue
:
{
providers
:
[
{
provide
:
NSFileSystem
,
deps
:
[
]
}
,
{
provide
:
ResourceLoader
,
useClass
:
FileSystemResourceLoader
,
deps
:
[
NSFileSystem
]
}
,
{
provide
:
ElementSchemaRegistry
,
useClass
:
NativeScriptElementSchemaRegistry
,
deps
:
[
]
}
,
]
}
,
multi
:
true
}
,
]
;
// Dynamic platform
const
_platformNativeScriptDynamic
:
PlatformFactory
=
createPlatformFactory
(
platformCoreDynamic
,
"nativeScriptDynamic"
,
[
...
COMMON_PROVIDERS
,
...
NS_COMPILER_PROVIDERS
]
)
;
export
function
platformNativeScriptDynamic
(
options
?:
AppOptions
,
extraProviders
?:
any
[
]
)
:
PlatformRef
{
// Return raw platform to advanced users only if explicitly requested
if
(
options
&&
options
.
bootInExistingPage
===
true
)
{
return
_platformNativeScriptDynamic
(
extraProviders
)
;
}
else
{
return
new
NativeScriptPlatformRef
(
_platformNativeScriptDynamic
(
extraProviders
)
,
options
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL