@@ -3,36 +3,49 @@ import './polyfills/array';
3
3
import './zone' ;
4
4
import { isPresent , Type } from 'angular2/src/facade/lang' ;
5
5
import { Promise , PromiseWrapper } from 'angular2/src/facade/async' ;
6
- import { ComponentRef } from 'angular2/src/ core/linker/dynamic_component_loader ' ;
6
+ import { platform , ComponentRef , PLATFORM_DIRECTIVES , PLATFORM_PIPES } from 'angular2/core' ;
7
7
import { bind , provide , Provider } from 'angular2/src/core/di' ;
8
- import { DOM } from 'angular2/src/core /dom/dom_adapter' ;
8
+ import { DOM } from 'angular2/src/platform /dom/dom_adapter' ;
9
9
10
10
import { Renderer } from 'angular2/src/core/render/api' ;
11
11
import { NativeScriptRenderer } from './renderer' ;
12
12
import { NativeScriptDomAdapter } from './dom_adapter' ;
13
13
import { XHR } from 'angular2/src/compiler/xhr' ;
14
14
import { FileSystemXHR } from './xhr' ;
15
- import { Parse5DomAdapter } from 'angular2/src/core/dom/parse5_adapter' ;
15
+ import { Parse5DomAdapter } from 'angular2/src/platform/server/parse5_adapter' ;
16
+ import { ExceptionHandler } from 'angular2/src/facade/exception_handler' ;
17
+ import { APPLICATION_COMMON_PROVIDERS } from 'angular2/src/core/application_common_providers' ;
18
+ import { COMPILER_PROVIDERS } from 'angular2/src/compiler/compiler' ;
19
+ import { PLATFORM_COMMON_PROVIDERS } from 'angular2/src/core/platform_common_providers' ;
20
+ import { COMMON_DIRECTIVES , COMMON_PIPES , FORM_PROVIDERS } from "angular2/common" ;
16
21
17
- import { bootstrap as angularBootstrap } from 'angular2/src/core/application' ;
18
- import { commonBootstrap } from 'angular2/src/core/application_common' ;
22
+ import { bootstrap as angularBootstrap } from 'angular2/bootstrap' ;
19
23
20
-
21
- export type BindingArray = Array < Type | Provider | any [ ] > ;
24
+ export type ProviderArray = Array < Type | Provider | any [ ] > ;
22
25
23
26
export function nativeScriptBootstrap ( appComponentType : any ,
24
- componentInjectableBindings : BindingArray = null ) : Promise < ComponentRef > {
27
+ customProviders : ProviderArray = null ) : Promise < ComponentRef > {
25
28
NativeScriptDomAdapter . makeCurrent ( ) ;
26
29
27
- let nativeScriptBindings : BindingArray = [
30
+ let nativeScriptProviders : ProviderArray = [
28
31
NativeScriptRenderer ,
29
32
provide ( Renderer , { useClass : NativeScriptRenderer } ) ,
30
33
provide ( XHR , { useClass : FileSystemXHR } ) ,
34
+ provide ( ExceptionHandler , { useFactory : ( ) => new ExceptionHandler ( DOM , true ) , deps : [ ] } ) ,
35
+
36
+ provide ( PLATFORM_PIPES , { useValue : COMMON_PIPES , multi : true } ) ,
37
+ provide ( PLATFORM_DIRECTIVES , { useValue : COMMON_DIRECTIVES , multi : true } ) ,
38
+
39
+ APPLICATION_COMMON_PROVIDERS ,
40
+ COMPILER_PROVIDERS ,
41
+ PLATFORM_COMMON_PROVIDERS ,
42
+ FORM_PROVIDERS ,
31
43
] ;
32
- var bindings = [ nativeScriptBindings ] ;
33
- if ( isPresent ( componentInjectableBindings ) ) {
34
- bindings . push ( componentInjectableBindings ) ;
44
+
45
+ var appProviders = [ ] ;
46
+ if ( isPresent ( customProviders ) ) {
47
+ appProviders . push ( customProviders ) ;
35
48
}
36
49
37
- return angularBootstrap ( appComponentType , bindings )
50
+ return platform ( nativeScriptProviders ) . application ( appProviders ) . bootstrap ( appComponentType ) ;
38
51
}
0 commit comments