Skip to content

Commit c9032ff

Browse files
author
Your Name
committed
Angular Universal Course
1 parent adb2508 commit c9032ff

File tree

4 files changed

+30
-1
lines changed

4 files changed

+30
-1
lines changed

.angular-cli.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,31 @@
2727
"dev": "environments/environment.ts",
2828
"prod": "environments/environment.prod.ts"
2929
}
30+
},
31+
{
32+
"root": "src",
33+
"outDir": "dist-server",
34+
"assets": [
35+
"assets",
36+
"favicon.ico"
37+
],
38+
"index": "index.html",
39+
"main": "main.server.ts",
40+
"test": "test.ts",
41+
"tsconfig": "tsconfig.server.json",
42+
"testTsconfig": "tsconfig.spec.json",
43+
"prefix": "",
44+
"styles": [
45+
"styles.scss"
46+
],
47+
"scripts": [],
48+
"environmentSource": "environments/environment.ts",
49+
"environments": {
50+
"dev": "environments/environment.ts",
51+
"prod": "environments/environment.prod.ts"
52+
},
53+
"platform": "server",
54+
"name": "ssr-app"
3055
}
3156
],
3257
"e2e": {

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ Thumbs.db
5050

5151
dist-server
5252
prerender.html
53+
54+
dist-server

src/app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { HttpClientModule} from '@angular/common/http';
4040
CourseDialogComponent,
4141
],
4242
imports: [
43-
BrowserModule,
43+
BrowserModule.withServerTransition({ appId: 'serverApp' }),
4444
BrowserAnimationsModule,
4545
MatMenuModule,
4646
MatButtonModule,

src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ if (environment.production) {
1111
}
1212

1313
document.addEventListener('DOMContentLoaded', () => {
14+
document.addEventListener('DOMContentLoaded', () => {
1415
platformBrowserDynamic().bootstrapModule(AppModule)
1516
.catch(err => console.log(err));
1617
});
18+
});

0 commit comments

Comments
 (0)