Home Task 01 - v1.0 - #6
DonskiLive wants to merge 1 commit into
Conversation
| @Component({ | ||
| selector: 'app-add-course', | ||
| templateUrl: './add-course.component.html', | ||
| styleUrls: ['./add-course.component.scss'], |
There was a problem hiding this comment.
I suggest to use ChangeDetection OnPush for all the components
| @@ -0,0 +1,34 @@ | |||
| <ng-container *ngFor="let course of courses; let i = index"> | |||
There was a problem hiding this comment.
take a look at trackBy param in ngFor loop , it could help optimize rendering
| public loadMore: boolean = false; | ||
| public preShowNumber: number = 2; | ||
|
|
||
| @Input() courses!: Course[]; |
There was a problem hiding this comment.
lets avoid usage of ! - it could lead a lot of bugs in runtime
Provide default value or make it optional instead
| constructor(private router: Router) {} | ||
|
|
||
| ngOnInit(): void {} |
There was a problem hiding this comment.
lets remove empty constructors and hooks
| @@ -0,0 +1,7 @@ | |||
| <div class="search-container"> | |||
There was a problem hiding this comment.
lets avoid of additional wrappers creation - to style the whole component you could use :host pseudo class in css
| MatCardModule, | ||
| MatFormFieldModule, | ||
| MatIconModule, | ||
| MatInputModule, |
There was a problem hiding this comment.
if you use external libraries like Material it make sence to create a separate module and export all used modules inside it
| @@ -0,0 +1,6 @@ | |||
| <div class="home-page-container"> | |||
| <breadcrumb #parent> | ||
| <ul class="breadcrumb"> | ||
| <ng-template ngFor let-route [ngForOf]="parent.breadcrumbs"> | ||
| <li *ngIf="!route.terminal" class="breadcrumb-item"> |
There was a problem hiding this comment.
instead of using 2 if statements consider usage of ng-container + *ngTemplateOutlet
No description provided.