Slide 13
Slide 13 text
Adjust your modules
Official guide
app.module.ts
app.server.module.ts
@NgModule({
declarations: [AppComponent],
imports: [
//common imports
]
})
export class AppModule {}
import {NgModule} from '@angular/core';
import {ServerModule} from '@angular/platform-server';
import {ModuleMapLoaderModule} from
‘@nguniversal/module-map-ngfactory-loader';
import {AppModule} from './app.module';
import {AppComponent} from './app.component';
@NgModule({
imports: [
AppModule,
ServerModule,
ModuleMapLoaderModule,
//server specific imports
],
bootstrap: [AppComponent],
})
export class AppServerModule {}
app.browser.module.ts
@NgModule({
bootstrap: [AppComponent],
imports: [
AppModule,
BrowserModule.withServerTransition({appId: '
//browser specific imports
]
})
export class AppModule {}
//browser specific imports
//server specific imports
SSR