@@ -4,7 +4,8 @@ import "zone.js/dist/zone-node"
44import 'reflect-metadata' ;
55import './polyfills/array' ;
66import { isPresent , Type } from 'angular2/src/facade/lang' ;
7- import { platform , ComponentRef , PlatformRef , PLATFORM_DIRECTIVES , PLATFORM_PIPES } from 'angular2/core' ;
7+ import { ReflectiveInjector , reflector , coreLoadAndBootstrap , createPlatform ,
8+ getPlatform , assertPlatform , ComponentRef , PlatformRef , PLATFORM_DIRECTIVES , PLATFORM_PIPES } from 'angular2/core' ;
89import { bind , provide , Provider } from 'angular2/src/core/di' ;
910import { DOM } from 'angular2/src/platform/dom/dom_adapter' ;
1011
@@ -20,8 +21,8 @@ import {COMPILER_PROVIDERS} from 'angular2/src/compiler/compiler';
2021import { PLATFORM_COMMON_PROVIDERS } from 'angular2/src/core/platform_common_providers' ;
2122import { COMMON_DIRECTIVES , COMMON_PIPES , FORM_PROVIDERS } from "angular2/common" ;
2223import { NS_DIRECTIVES } from './directives' ;
23-
24- import { bootstrap as angularBootstrap } from 'angular2/bootstrap ' ;
24+ import { ReflectionCapabilities } from 'angular2/src/core/reflection/reflection_capabilities' ;
25+ import { bootstrap as angularBootstrap } from 'angular2/platform/browser ' ;
2526
2627import { Page } from 'ui/page' ;
2728import { TextView } from 'ui/text-view' ;
@@ -34,8 +35,6 @@ import {defaultPageProvider, defaultDeviceProvider} from "./platform-providers";
3435import * as nativescriptIntl from "nativescript-intl" ;
3536global . Intl = nativescriptIntl ;
3637
37- let _platform : PlatformRef = null ;
38-
3938export interface AppOptions {
4039 cssFile ?: string ;
4140 startPageActionBarHidden ?: boolean ;
@@ -72,10 +71,14 @@ export function bootstrap(appComponentType: any,
7271 appProviders . push ( customProviders ) ;
7372 }
7473
75- if ( ! _platform ) {
76- _platform = platform ( platformProviders ) ;
74+ var platform = getPlatform ( ) ;
75+ if ( ! isPresent ( platform ) ) {
76+ platform = createPlatform ( ReflectiveInjector . resolveAndCreate ( platformProviders ) ) ;
7777 }
78- return _platform . application ( appProviders ) . bootstrap ( appComponentType ) ;
78+
79+ reflector . reflectionCapabilities = new ReflectionCapabilities ( ) ;
80+ var appInjector = ReflectiveInjector . resolveAndCreate ( appProviders , platform . injector ) ;
81+ return coreLoadAndBootstrap ( appInjector , appComponentType ) ;
7982}
8083
8184export function nativeScriptBootstrap ( appComponentType : any , customProviders ?: ProviderArray , appOptions ?: AppOptions ) : Promise < ComponentRef > {
0 commit comments