app.server.module.ts (660B)
1 import {NgModule} from '@angular/core'; 2 import {ServerModule} from '@angular/platform-server'; 3 import {ModuleMapLoaderModule} from '@nguniversal/module-map-ngfactory-loader'; 4 5 import {AppModule} from './app.module'; 6 import {AppComponent} from './app.component'; 7 8 @NgModule({ 9 imports: [ 10 // The AppServerModule should import your AppModule followed 11 // by the ServerModule from @angular/platform-server. 12 AppModule, 13 ServerModule, 14 ModuleMapLoaderModule, 15 ], 16 // Since the bootstrapped component is not inherited from your 17 // imported AppModule, it needs to be repeated here. 18 bootstrap: [AppComponent], 19 }) 20 export class AppServerModule {}