File tree 5 files changed +13
-5
lines changed
5 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1
1
import { provide } from '@angular/core' ;
2
2
import { APP_BASE_HREF } from '@angular/common' ;
3
+ import { APP_SHELL_BUILD_PROVIDERS } from '@angular/app-shell' ;
3
4
import { < %= jsComponentName % > AppComponent } from './app/' ;
4
5
import {
5
6
REQUEST_URL ,
@@ -12,6 +13,7 @@ export const options = {
12
13
< %= jsComponentName % > AppComponent
13
14
] ,
14
15
platformProviders : [
16
+ APP_SHELL_BUILD_PROVIDERS ,
15
17
provide ( ORIGIN_URL , {
16
18
useValue : ''
17
19
} )
Original file line number Diff line number Diff line change 1
- import { Component } from '@angular/core' ;
1
+ import { Component } from '@angular/core' ; < % if ( isMobile ) { % >
2
+ import { APP_SHELL_DIRECTIVES } from '@angular/app-shell' ; < % } % >
2
3
3
4
@Component ( {
4
5
moduleId : module . id ,
@@ -8,7 +9,8 @@ import { Component } from '@angular/core';
8
9
{{title}}
9
10
</h1>
10
11
` ,
11
- styles : [ ] < % } else { % > templateUrl : '<%= htmlComponentName %>.component.html' ,
12
+ styles : [ ] ,
13
+ directives : [ APP_SHELL_DIRECTIVES ] < % } else { % > templateUrl : '<%= htmlComponentName %>.component.html' ,
12
14
styleUrls : [ '<%= dasherizedModuleName %>.component.css' ] < % } % >
13
15
} )
14
16
export class < %= jsComponentName % > AppComponent {
Original file line number Diff line number Diff line change 1
1
import { bootstrap } from '@angular/platform-browser-dynamic' ;
2
2
import { enableProdMode } from '@angular/core' ;
3
- import { < %= jsComponentName % > AppComponent , environment } from './app/' ;
3
+ import { < %= jsComponentName % > AppComponent , environment } from './app/' ; < % if ( isMobile ) { % >
4
+ import { APP_SHELL_RUNTIME_PROVIDERS } from '@angular/app-shell' ; < % } % >
4
5
5
6
if ( environment . production ) {
6
7
enableProdMode ( ) ;
7
8
}
8
9
9
- bootstrap ( < %= jsComponentName % > AppComponent ) ;
10
+ bootstrap ( < %= jsComponentName % > AppComponent < % if ( isMobile ) { % > , [ APP_SHELL_RUNTIME_PROVIDERS ] < % } % > ) ;
11
+
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ const barrels: string[] = [
21
21
'@angular/http' ,
22
22
'@angular/router' ,
23
23
'@angular/platform-browser' ,
24
- '@angular/platform-browser-dynamic' ,
24
+ '@angular/platform-browser-dynamic' , < % if ( isMobile ) { % >
25
+ '@angular/app-shell' , < % } % >
25
26
26
27
// Thirdparty barrels.
27
28
'rxjs' ,
Original file line number Diff line number Diff line change 30
30
"@angular/platform-server" : " 2.0.0-rc.1" ,
31
31
"@angular/router-deprecated" : " 2.0.0-rc.1" ,
32
32
"@angular/service-worker" : " ^0.2.0" ,
33
+ "@angular/app-shell" : " ^0.0.0" ,
33
34
"angular2-broccoli-prerender" : " ^0.11.0" ,
34
35
"angular2-universal" :" ^0.100.3" ,
35
36
"angular2-universal-polyfills" : " ^0.4.1" ,
You can’t perform that action at this time.
0 commit comments