diff --git a/src/components/schedule-tabs/schedule-tabs-professor/schedule-tabs-professor.component.ts b/src/components/schedule-tabs/schedule-tabs-professor/schedule-tabs-professor.component.ts index 7cacdef..51c61ff 100644 --- a/src/components/schedule-tabs/schedule-tabs-professor/schedule-tabs-professor.component.ts +++ b/src/components/schedule-tabs/schedule-tabs-professor/schedule-tabs-professor.component.ts @@ -1,13 +1,7 @@ import {Component, EventEmitter, Input, OnInit, Output} from "@angular/core"; import {MatFormField, MatInput} from "@angular/material/input"; -import {FormControl, FormsModule, ReactiveFormsModule} from "@angular/forms"; -import { - MatAutocomplete, - MatAutocompleteSelectedEvent, - MatAutocompleteTrigger, - MatOptgroup, - MatOption -} from "@angular/material/autocomplete"; +import {FormControl, ReactiveFormsModule} from "@angular/forms"; +import {MatAutocompleteModule, MatAutocompleteSelectedEvent} from "@angular/material/autocomplete"; import {AsyncPipe} from "@angular/common"; import {DataSpinnerComponent} from "@component/data-spinner/data-spinner.component"; import {map, Observable, startWith} from "rxjs"; @@ -22,16 +16,12 @@ export interface Professors { selector: 'app-schedule-tabs-professor', standalone: true, imports: [ + MatAutocompleteModule, MatFormField, - MatInput, - FormsModule, - MatAutocompleteTrigger, - MatAutocomplete, - MatOptgroup, - ReactiveFormsModule, - MatOption, + DataSpinnerComponent, AsyncPipe, - DataSpinnerComponent + ReactiveFormsModule, + MatInput ], templateUrl: './schedule-tabs-professor.component.html', styleUrl: './schedule-tabs-professor.component.css' @@ -41,7 +31,7 @@ export class ScheduleTabsProfessorComponent implements OnInit { protected filteredTeachers!: Observable; @Input() teachers: Professors[] = []; - @Output() optionSelected = new EventEmitter(); + @Output() professorSelected = new EventEmitter(); ngOnInit(): void { this.filteredTeachers = this.teacherControl.valueChanges.pipe( @@ -65,7 +55,7 @@ export class ScheduleTabsProfessorComponent implements OnInit { const selectedOption = this.teachers.find(teacher => teacher.id === event.option.value); if (selectedOption) { this.teacherControl.setValue(selectedOption.name); - this.optionSelected.emit(selectedOption.id); + this.professorSelected.emit(selectedOption.id); } } }