1
1
import { topmost , Frame } from "ui/frame" ;
2
2
import { Page } from "ui/page" ;
3
3
import { OpaqueToken } from "@angular/core" ;
4
- import { device } from "platform" ;
4
+ import { device , Device } from "platform" ;
5
5
import * as platform from "platform" ;
6
6
7
7
export const APP_ROOT_VIEW = new OpaqueToken ( "App Root View" ) ;
@@ -15,6 +15,7 @@ if (global.___TS_UNUSED) {
15
15
} ) ( ) ;
16
16
}
17
17
18
+ // Use an exported function to make the AoT compiler happy.
18
19
export function getDefaultPage ( ) : Page {
19
20
const frame = topmost ( ) ;
20
21
if ( frame ) {
@@ -23,11 +24,22 @@ export function getDefaultPage(): Page {
23
24
return null ;
24
25
}
25
26
}
27
+
26
28
export const defaultPageProvider = { provide : Page , useFactory : getDefaultPage } ;
27
29
28
- export const defaultFrameProvider = { provide : Frame , useFactory : topmost } ;
30
+ // Use an exported function to make the AoT compiler happy.
31
+ export function getDefaultFrame ( ) : Frame {
32
+ return topmost ( ) ;
33
+ }
34
+
35
+ export const defaultFrameProvider = { provide : Frame , useFactory : getDefaultFrame } ;
36
+
37
+ // Use an exported function to make the AoT compiler happy.
38
+ export function getDefaultDevice ( ) : Device {
39
+ return device ;
40
+ }
29
41
30
- export const defaultDeviceProvider = { provide : DEVICE , useValue : device } ;
42
+ export const defaultDeviceProvider = { provide : DEVICE , useFactory : getDefaultDevice } ;
31
43
32
44
export type PageFactory = ( options : PageFactoryOptions ) => Page ;
33
45
export interface PageFactoryOptions {
0 commit comments