Skip to content

Commit 73014d9

Browse files
MarkPieszakhansl
authored andcommitted
docs: universal
1 parent 18baeab commit 73014d9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/documentation/stories/universal-rendering.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,14 @@ This example places it alongside `app.module.ts` in a file named `app.server.mod
5555

5656
### src/app/app.server.module.ts:
5757

58+
You can see here we're simply Importing everything from AppModule, followed by ServerModule.
59+
60+
> One important thing to Note: We need `ModuleMapLoaderModule` to help make Lazy-loaded routes possible during Server-side renders with the Angular-CLI.
61+
5862
```typescript
5963
import {NgModule} from '@angular/core';
6064
import {ServerModule} from '@angular/platform-server';
65+
import {ModuleMapLoaderModule} from '@nguniversal/module-map-ngfactory-loader';
6166

6267
import {AppModule} from './app.module';
6368
import {AppComponent} from './app.component';
@@ -67,7 +72,8 @@ import {AppComponent} from './app.component';
6772
// The AppServerModule should import your AppModule followed
6873
// by the ServerModule from @angular/platform-server.
6974
AppModule,
70-
ServerModule,
75+
ServerModule,
76+
ModuleMapLoaderModule // <-- *Important* to have lazy-loaded routes work
7177
],
7278
// Since the bootstrapped component is not inherited from your
7379
// imported AppModule, it needs to be repeated here.

0 commit comments

Comments
 (0)