Skip to content

Commit 21d9aad

Browse files
committed
Angular Universal Course
1 parent 739194c commit 21d9aad

7 files changed

+94
-33
lines changed

src/app/about/about.component.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
.course-image {
3+
max-width: 300px;
4+
border-radius: 4px;
5+
}
6+
7+
8+
.not-found {
9+
padding: 40px;
10+
display: flex;
11+
flex-direction: column;
12+
font-family: "Roboto";
13+
}
14+
15+
16+
.about button {
17+
max-width: 100px;
18+
margin-top: 30px;
19+
}

src/app/about/about.component.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
<div class="not-found">
4+
5+
<h1>Angular Universal In Depth</h1>
6+
7+
<img class="course-image mat-elevation-z10"
8+
src="https://angular-university.s3-us-west-1.amazonaws.com/course-images/angular-universal-course.jpg">
9+
10+
<h2>About this course</h2>
11+
<p>Use Angular on the server too! Learn Angular Server-Side Rendering.</p>
12+
13+
</div>
14+

src/app/about/about.component.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import {Component, OnInit, ViewEncapsulation} from '@angular/core';
2+
import {
3+
concat,
4+
fromEvent,
5+
interval,
6+
noop,
7+
observable,
8+
Observable,
9+
of,
10+
timer,
11+
merge,
12+
Subject,
13+
BehaviorSubject,
14+
AsyncSubject,
15+
ReplaySubject, from
16+
} from 'rxjs';
17+
import {delayWhen, filter, map, take, timeout} from 'rxjs/operators';
18+
19+
20+
21+
@Component({
22+
selector: 'about',
23+
templateUrl: './about.component.html',
24+
styleUrls: ['./about.component.css']
25+
})
26+
export class AboutComponent implements OnInit {
27+
28+
ngOnInit() {
29+
30+
31+
}
32+
33+
34+
run() {
35+
36+
37+
38+
}
39+
40+
41+
}
42+
43+
44+
45+
46+
47+

src/app/app-routing.module.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@ import { Routes, RouterModule } from '@angular/router';
33
import {HomeComponent} from "./home/home.component";
44
import {CourseComponent} from "./course/course.component";
55
import {CourseResolver} from "./services/course.resolver";
6+
import {AboutComponent} from './about/about.component';
67

78
const routes: Routes = [
89
{
910
path: "",
1011
component: HomeComponent
1112

1213
},
14+
{
15+
path: 'about',
16+
component: AboutComponent
17+
},
1318
{
1419
path: 'courses/:id',
1520
component: CourseComponent,

src/app/app.component.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<mat-sidenav-container fullscreen>
22

3-
<mat-sidenav #start>
3+
<mat-sidenav #start (click)="start.close()">
4+
45
<mat-nav-list>
56

67
<a mat-list-item routerLink="/">
78
<mat-icon>library_books</mat-icon>
89
<span>Courses</span>
910
</a>
1011

12+
<a mat-list-item routerLink="/about">
13+
<span>About</span>
14+
</a>
15+
1116
<a mat-list-item>
1217
<mat-icon>person_add</mat-icon>
1318
<span>Register</span>
@@ -32,4 +37,4 @@
3237
<router-outlet></router-outlet>
3338

3439

35-
</mat-sidenav-container>
40+
</mat-sidenav-container>

src/app/app.component.spec.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { CourseDialogComponent } from './course-dialog/course-dialog.component';
2929
import {ReactiveFormsModule} from "@angular/forms";
3030
import {MatMomentDateModule} from "@angular/material-moment-adapter";
3131
import { HttpClientModule} from '@angular/common/http';
32+
import {AboutComponent} from './about/about.component';
3233

3334

3435

@@ -41,6 +42,7 @@ import { HttpClientModule} from '@angular/common/http';
4142
CourseComponent,
4243
CoursesCardListComponent,
4344
CourseDialogComponent,
45+
AboutComponent
4446
],
4547
imports: [
4648
BrowserModule,

0 commit comments

Comments
 (0)