Skip to content

Commit 6d8c494

Browse files
author
Your Name
committed
Angular Universal In Depth
1 parent 01e0965 commit 6d8c494

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/app/course/course.component.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export class CourseComponent implements OnInit {
2828

2929
constructor(
3030
private route: ActivatedRoute,
31-
private coursesService: CoursesService) {
31+
private coursesService: CoursesService,
32+
private title: Title,
33+
private meta: Meta) {
3234

3335
}
3436

@@ -38,6 +40,18 @@ export class CourseComponent implements OnInit {
3840

3941
this.course = this.route.snapshot.data["course"];
4042

43+
this.title.setTitle(this.course.description);
44+
45+
this.meta.updateTag({name: "description", content: this.course.longDescription});
46+
47+
this.meta.addTag({name: 'twitter:card', content: 'summary'});
48+
this.meta.addTag({name: 'twitter:site', content: '@AngularUniv'});
49+
this.meta.addTag({name: 'twitter:title', content: this.course.description});
50+
this.meta.addTag({name: 'twitter:description', content: this.course.description});
51+
this.meta.addTag({name: 'twitter:text:description', content: this.course.description});
52+
this.meta.addTag({name: 'twitter:image', content: 'https://avatars3.githubusercontent.com/u/16628445?v=3&s=200'});
53+
54+
4155
this.dataSource = new MatTableDataSource([]);
4256

4357
this.coursesService.findAllCourseLessons(this.course.id)

0 commit comments

Comments
 (0)