Enabled strict template mode in Angular

Code cleanup
This commit is contained in:
Tzahi12345
2023-01-29 15:51:50 -05:00
parent e82066b2cd
commit 6010d991fb
21 changed files with 61 additions and 49 deletions

View File

@@ -5,7 +5,7 @@
<div class="example-header">
<mat-form-field appearance="outline">
<mat-label i18n="Search">Search</mat-label>
<input matInput (keyup)="applyFilter($event.target.value)">
<input matInput (keyup)="applyFilter($event)">
</mat-form-field>
</div>

View File

@@ -63,7 +63,8 @@ export class ModifyUsersComponent implements OnInit, AfterViewInit {
this.pageSizeOptions = setPageSizeOptionsInput.split(',').map(str => +str);
}
applyFilter(filterValue: string) {
applyFilter(event: KeyboardEvent) {
let filterValue = (event.target as HTMLInputElement).value; // "as HTMLInputElement" is required: https://angular.io/guide/user-input#type-the-event
filterValue = filterValue.trim(); // Remove whitespace
filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches
this.dataSource.filter = filterValue;