Skip to content

Commit 58a1e99

Browse files
author
Your Name
committed
Angular Core Deep Dive
1 parent ab5386b commit 58a1e99

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
3+
4+
.course-card.beginner {
5+
6+
background: lightsalmon;
7+
}

src/app/course-card/course-card.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<div class="course-card" *ngIf="course">
1+
<div class="course-card" *ngIf="course"
2+
[ngClass]="cardClasses()">
23

34
<div class="course-title">
45
{{ cardIndex + ' ' + course.description }}

src/app/course-card/course-card.component.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,17 @@ export class CourseCardComponent implements OnInit {
3030

3131
onCourseViewed() {
3232

33-
console.log("card component - button clicked ...");
33+
console.log('card component - button clicked ...');
3434

3535
this.courseEmitter.emit(this.course);
3636

3737
}
3838

39+
cardClasses() {
40+
if (this.course.category == 'BEGINNER') {
41+
return 'beginner';
42+
}
43+
}
44+
45+
3946
}

src/db-data.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
export const COURSES: any = [
44

5-
undefined,
6-
75
{
86
id: 1,
97
description: "Angular Core Deep Dive",
8+
iconUrl: 'https://s3-us-west-1.amazonaws.com/angular-university/course-images/angular-core-in-depth-small.png',
109
longDescription: "A detailed walk-through of the most important part of Angular - the Core and Common modules",
1110
category: 'ADVANCED',
1211
lessonsCount: 10

0 commit comments

Comments
 (0)