Task 2#2
Conversation
YurikMurik
commented
May 3, 2020
- 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) { |
There was a problem hiding this comment.
убираем волшебные числа в константы
There was a problem hiding this comment.
добавил const MINUTE_IN_SEC: number = 60
| }) | ||
| export class CourseItemComponent { | ||
| @Input() public item: CourseItemInfo; | ||
| @Input() public routerLink: object; |
There was a problem hiding this comment.
object убрать, заменить типом
| export class CourseItemComponent { | ||
| @Input() public item: CourseItemInfo; | ||
| @Input() public routerLink: object; | ||
| @Output() public onDeleteCourse: EventEmitter<number> = new EventEmitter<number>(); |
| <app-course-item | ||
| (onDeleteCourse)="onDeleteCourse($event)" | ||
| *ngFor="let item of courses" | ||
| [item] = 'item' |
There was a problem hiding this comment.
double quotes html
done
| public faSearchIcon: IconDefinition = faSearch; | ||
|
|
||
| public searchCourses(e: Event, value: string): void { | ||
| e.preventDefault(); |
There was a problem hiding this comment.
а зачем тут preventDefault?
There was a problem hiding this comment.
а зачем тут preventDefault?
поменял метод, теперь он просто делает console.log значения переменной, которая завязана на изменения в инпуте серча
| @@ -1 +1,7 @@ | |||
| <p>search works!</p> | |||
| <div class="toolbox-search"> | |||
| <form> | |||
There was a problem hiding this comment.
для одного инпута не нужно добавлять форму
There was a problem hiding this comment.
для одного инпута не нужно добавлять форму
пофиксил
| <fa-icon [icon]="editButtonIcon"></fa-icon> | ||
| Edit | ||
| </button> | ||
| <button (click)="onDeleteCourse.emit(item.id)"> |
There was a problem hiding this comment.
emit заворачиваем в метод и вызываем из ts файла
There was a problem hiding this comment.
emit заворачиваем в метод и вызываем из ts файла
пофиксил
b63576d to
0eb6965
Compare