Skip to content
Snippets Groups Projects
Commit f4afb371 authored by Scott Berg's avatar Scott Berg
Browse files

ROENROLL-1457

parent a40e1e5f
No related branches found
No related tags found
No related merge requests found
Pipeline #34603 passed
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
<mat-form-field class="example-full-width"> <mat-form-field class="example-full-width">
<input type="text" placeholder="Subject" aria-label="Subject" matInput #subjectInput formControlName="subject" [matAutocomplete]="subject"> <input type="text" placeholder="Subject" aria-label="Subject" matInput #subjectInput formControlName="subject" [matAutocomplete]="subject">
<mat-autocomplete autoActiveFirstOption #subject="matAutocomplete"> <mat-autocomplete autoActiveFirstOption #subject="matAutocomplete" (optionSelected)="subjectChange($event, subjectInput)">
<mat-option *ngFor="let subject of filteredSubjects" [value]="subject | titlecase" (onSelectionChange)="subjectChange($event, subjectInput)">{{subject | titlecase}}</mat-option> <mat-option *ngFor="let subject of filteredSubjects" [value]="subject | titlecase">{{subject | titlecase}}</mat-option>
</mat-autocomplete> </mat-autocomplete>
</mat-form-field> </mat-form-field>
......
...@@ -160,10 +160,7 @@ export class CourseSearchComponent implements OnInit, OnDestroy { ...@@ -160,10 +160,7 @@ export class CourseSearchComponent implements OnInit, OnDestroy {
} }
public subjectChange($event, input) { public subjectChange($event, input) {
console.log(input); const { search, term, subject } = this.courseSearchForm.value;
const subject = $event.source.value;
const { search, term } = this.courseSearchForm.value;
this.search(search, term, subject); this.search(search, term, subject);
// Focus is needed to keep the cursor at the start of the input after a selection is made // Focus is needed to keep the cursor at the start of the input after a selection is made
...@@ -189,7 +186,6 @@ export class CourseSearchComponent implements OnInit, OnDestroy { ...@@ -189,7 +186,6 @@ export class CourseSearchComponent implements OnInit, OnDestroy {
// Run a search and display all results if the serach is valid // Run a search and display all results if the serach is valid
public search(search, term, subject) { public search(search, term, subject) {
// Get the form field values // Get the form field values
console.log(subject);
// Check if subject is valid // Check if subject is valid
const subjectCode = this.getSubjectCode(subject); const subjectCode = this.getSubjectCode(subject);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment