File tree Expand file tree Collapse file tree 5 files changed +16
-8
lines changed
Expand file tree Collapse file tree 5 files changed +16
-8
lines changed Original file line number Diff line number Diff line change 1- import { provide } from '@angular/core' ;
2- import { APP_BASE_HREF } from '@angular/common' ;
3- import { < %= jsComponentName % > AppComponent } from './app/' ;
1+ import { provide } from '@angular/core' ;
2+ import { APP_BASE_HREF } from '@angular/common' ;
3+ import { APP_SHELL_BUILD_PROVIDERS } from '@angular/app-shell' ;
4+ import { < %= jsComponentName % > AppComponent } from './app/' ;
45import {
56 REQUEST_URL ,
67 ORIGIN_URL
@@ -12,6 +13,7 @@ export const options = {
1213 < %= jsComponentName % > AppComponent
1314 ] ,
1415 platformProviders : [
16+ APP_SHELL_BUILD_PROVIDERS ,
1517 provide ( ORIGIN_URL , {
1618 useValue : ''
1719 } )
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' ; < % } % >
23
34@Component ( {
45 moduleId : module . id ,
@@ -8,7 +9,8 @@ import { Component } from '@angular/core';
89 {{title}}
910 </h1>
1011 ` ,
11- styles : [ ] < % } else { % > templateUrl : '<%= htmlComponentName %>.component.html' ,
12+ styles : [ ] ,
13+ directives : [ APP_SHELL_DIRECTIVES ] < % } else { % > templateUrl : '<%= htmlComponentName %>.component.html' ,
1214 styleUrls : [ '<%= dasherizedModuleName %>.component.css' ] < % } % >
1315} )
1416export class < %= jsComponentName % > AppComponent {
Original file line number Diff line number Diff line change 11import { bootstrap } from '@angular/platform-browser-dynamic' ;
22import { 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' ; < % } % >
45
56if ( environment . production ) {
67 enableProdMode ( ) ;
78}
89
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[] = [
2121 '@angular/http' ,
2222 '@angular/router' ,
2323 '@angular/platform-browser' ,
24- '@angular/platform-browser-dynamic' ,
24+ '@angular/platform-browser-dynamic' , < % if ( isMobile ) { % >
25+ '@angular/app-shell' , < % } % >
2526
2627 // Thirdparty barrels.
2728 'rxjs' ,
Original file line number Diff line number Diff line change 3030 "@angular/platform-server" : " 2.0.0-rc.1" ,
3131 "@angular/router-deprecated" : " 2.0.0-rc.1" ,
3232 "@angular/service-worker" : " ^0.2.0" ,
33+ "@angular/app-shell" : " ^0.0.0" ,
3334 "angular2-broccoli-prerender" : " ^0.11.0" ,
3435 "angular2-universal" :" ^0.100.3" ,
3536 "angular2-universal-polyfills" : " ^0.4.1" ,
You can’t perform that action at this time.
0 commit comments