Skip to content

Home Task 01 - v1.0 - #6

Open
DonskiLive wants to merge 1 commit into
litwin90:mainfrom
DonskiLive:task01
Open

DonskiLive wants to merge 1 commit into
litwin90:mainfrom
DonskiLive:task01

Conversation

@DonskiLive

Copy link
Copy Markdown

No description provided.

@Component({
selector: 'app-add-course',
templateUrl: './add-course.component.html',
styleUrls: ['./add-course.component.scss'],

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,34 @@
<ng-container *ngFor="let course of courses; let i = index">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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[];

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets avoid usage of ! - it could lead a lot of bugs in runtime
Provide default value or make it optional instead

Comment on lines +17 to +19
constructor(private router: Router) {}

ngOnInit(): void {}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets remove empty constructors and hooks

@@ -0,0 +1,7 @@
<div class="search-container">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets avoid of additional wrappers creation - to style the whole component you could use :host pseudo class in css

Comment on lines +23 to +26
MatCardModule,
MatFormFieldModule,
MatIconModule,
MatInputModule,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need in this wrapper

<breadcrumb #parent>
<ul class="breadcrumb">
<ng-template ngFor let-route [ngForOf]="parent.breadcrumbs">
<li *ngIf="!route.terminal" class="breadcrumb-item">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of using 2 if statements consider usage of ng-container + *ngTemplateOutlet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants