Skip to content

Commit d4c8023

Browse files
author
Your Name
committed
Angular Universal Course
1 parent 927dbe7 commit d4c8023

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/app/course/course.component.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ export class CourseComponent implements OnInit {
2626

2727
constructor(
2828
private route: ActivatedRoute,
29-
private coursesService: CoursesService) {
29+
private coursesService: CoursesService,
30+
private title: Title,
31+
private meta:Meta) {
3032

3133
}
3234

@@ -41,7 +43,26 @@ export class CourseComponent implements OnInit {
4143
this.coursesService.findAllCourseLessons(this.course.id)
4244
.subscribe(lessons => this.dataSource.data = lessons);
4345

46+
this.title.setTitle(this.course.description);
47+
48+
this.meta.addTag({name: "description", content: this.course.longDescription});
49+
50+
this.meta.addTag({name: "twitter:card", content: "summary"});
51+
this.meta.addTag({name: "twitter:site", content: "@AngularUniv"});
52+
this.meta.addTag({name: "twitter:title", content: this.course.description});
53+
this.meta.addTag({name: "twitter:description", content: this.course.description});
54+
this.meta.addTag({name: "twitter:text:description", content: this.course.description});
55+
this.meta.addTag({name:"twitter:image", content: "https://avatars3.githubusercontent.com/u/16628445?v=3&s=200"});
56+
57+
4458
}
4559

4660

4761
}
62+
63+
64+
65+
66+
67+
68+

0 commit comments

Comments
 (0)