Avoid later cast through type in declarations

This commit is contained in:
Will Abson
2016-10-31 16:58:15 +00:00
parent c100412538
commit 88d21a4bbd

View File

@@ -128,8 +128,8 @@ export class AlfrescoSearchAutocompleteComponent implements OnInit, OnChanges {
} }
focusResult(): void { focusResult(): void {
let firstResult = this.resultsTableBody.nativeElement.querySelector('tr'); let firstResult: any = this.resultsTableBody.nativeElement.querySelector('tr');
(<any> firstResult).focus(); firstResult.focus();
} }
onItemClick(node): void { onItemClick(node): void {
@@ -169,16 +169,16 @@ export class AlfrescoSearchAutocompleteComponent implements OnInit, OnChanges {
} }
onRowArrowDown($event: KeyboardEvent): void { onRowArrowDown($event: KeyboardEvent): void {
let nextElement = this.getNextElementSibling(<Element> $event.target); let nextElement: any = this.getNextElementSibling(<Element> $event.target);
if (nextElement) { if (nextElement) {
(<any> nextElement).focus(); nextElement.focus();
} }
} }
onRowArrowUp($event: KeyboardEvent): void { onRowArrowUp($event: KeyboardEvent): void {
let previousElement = this.getPreviousElementSibling(<Element> $event.target); let previousElement: any = this.getPreviousElementSibling(<Element> $event.target);
if (previousElement) { if (previousElement) {
(<any> previousElement).focus(); previousElement.focus();
} else { } else {
this.scrollBack.emit($event); this.scrollBack.emit($event);
} }