Skip to content

Task 2#2

Open
YurikMurik wants to merge 1 commit intotask-1from
task-2
Open

Task 2#2
YurikMurik wants to merge 1 commit intotask-1from
task-2

Conversation

@YurikMurik
Copy link
Copy Markdown
Owner

  • Added simple routing for components
  • Changed the structure of components and modules in project
  • Added pipe for time transforming
  • Implemented markup + styles + logic for all project's components

@Pipe({name: 'transformMinutesToHours'})
export class TransformMinutesToHoursPipe implements PipeTransform {
public transform(time: number): string {
if (time < 60) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

убираем волшебные числа в константы

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

добавил const MINUTE_IN_SEC: number = 60

})
export class CourseItemComponent {
@Input() public item: CourseItemInfo;
@Input() public routerLink: object;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

object убрать, заменить типом

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

заменил на тип Router

@YurikMurik YurikMurik changed the base branch from master to task-1 May 4, 2020 19:11
export class CourseItemComponent {
@Input() public item: CourseItemInfo;
@Input() public routerLink: object;
@Output() public onDeleteCourse: EventEmitter<number> = new EventEmitter<number>();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@output() public onDeleteCourse: EventEmitter = new EventEmitter();

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@output() public onDeleteCourse: EventEmitter = new EventEmitter();

пофиксил

<app-course-item
(onDeleteCourse)="onDeleteCourse($event)"
*ngFor="let item of courses"
[item] = 'item'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

double quotes html

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

double quotes html

done

public faSearchIcon: IconDefinition = faSearch;

public searchCourses(e: Event, value: string): void {
e.preventDefault();
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

а зачем тут preventDefault?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

а зачем тут preventDefault?

поменял метод, теперь он просто делает console.log значения переменной, которая завязана на изменения в инпуте серча

@@ -1 +1,7 @@
<p>search works!</p>
<div class="toolbox-search">
<form>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

для одного инпута не нужно добавлять форму

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

для одного инпута не нужно добавлять форму

пофиксил

<fa-icon [icon]="editButtonIcon"></fa-icon>
Edit
</button>
<button (click)="onDeleteCourse.emit(item.id)">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

emit заворачиваем в метод и вызываем из ts файла

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

emit заворачиваем в метод и вызываем из ts файла

пофиксил

@YurikMurik YurikMurik force-pushed the task-2 branch 2 times, most recently from b63576d to 0eb6965 Compare May 5, 2020 10:42
- Added simple routing for compnonents
- Changed the structure of components and modules in project
- Added pipe for time transforming
- Implemented markup + styles + logic for all project's components
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