From ae7aef5f0ba2fc27e1f28bf602c2ac3aecede8b6 Mon Sep 17 00:00:00 2001 From: Trey Richards Date: Tue, 31 Jan 2017 14:00:31 -0800 Subject: [PATCH] Fixed issues with variables of unspecified type. Fixed issues with functions not returning values from all paths. --- .../tag-input-autocomplete.component.ts | 6 ++++-- lib/components/tag-input/tag-input.component.ts | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/components/tag-input-autocomplete/tag-input-autocomplete.component.ts b/lib/components/tag-input-autocomplete/tag-input-autocomplete.component.ts index 6ec185e..15ab457 100644 --- a/lib/components/tag-input-autocomplete/tag-input-autocomplete.component.ts +++ b/lib/components/tag-input-autocomplete/tag-input-autocomplete.component.ts @@ -117,7 +117,7 @@ export class TagInputAutocompleteComponent implements OnChanges, OnDestroy, OnIn this.ensureHighlightVisible(); } - goToBottom(itemsCount) { + goToBottom(itemsCount: any) { this.selectedItemIndex = itemsCount - 1; this.ensureHighlightVisible(); } @@ -146,6 +146,7 @@ export class TagInputAutocompleteComponent implements OnChanges, OnDestroy, OnIn return false; } this.goToPrevious(); + return false; } handleDownArrow() { @@ -155,6 +156,7 @@ export class TagInputAutocompleteComponent implements OnChanges, OnDestroy, OnIn return false; } this.goToNext(); + return false; } selectItem(itemIndex?: number): void { @@ -164,7 +166,7 @@ export class TagInputAutocompleteComponent implements OnChanges, OnDestroy, OnIn } } - ngOnChanges(changes) { + ngOnChanges(changes: any) { if (this.selectFirstItem && this.itemsCount > 0) { this.goToTop(); } diff --git a/lib/components/tag-input/tag-input.component.ts b/lib/components/tag-input/tag-input.component.ts index d1f23e7..a532a93 100644 --- a/lib/components/tag-input/tag-input.component.ts +++ b/lib/components/tag-input/tag-input.component.ts @@ -102,7 +102,7 @@ export interface AutoCompleteItem { ] }) export class TagInputComponent implements ControlValueAccessor, OnDestroy, OnInit { - @HostBinding('class.ng2-tag-input-focus') isFocused; + @HostBinding('class.ng2-tag-input-focus') isFocused: boolean; @Input() addOnBlur: boolean = true; @Input() addOnComma: boolean = true; @Input() addOnEnter: boolean = true; @@ -202,7 +202,7 @@ export class TagInputComponent implements ControlValueAccessor, OnDestroy, OnIni } } - onInputBlurred(event): void { + onInputBlurred(event: any): void { if (this.addOnBlur) { this._addTags([this.inputValue]); } this.isFocused = false; } @@ -212,7 +212,7 @@ export class TagInputComponent implements ControlValueAccessor, OnDestroy, OnIni setTimeout(() => this.canShowAutoComplete = true); } - onInputPaste(event): void { + onInputPaste(event: any): void { let clipboardData = event.clipboardData || (event.originalEvent && event.originalEvent.clipboardData); let pastedString = clipboardData.getData('text/plain'); let tags = this._splitString(pastedString); @@ -220,7 +220,7 @@ export class TagInputComponent implements ControlValueAccessor, OnDestroy, OnIni setTimeout(() => this._resetInput()); } - onAutocompleteSelect(selectedItem) { + onAutocompleteSelect(selectedItem: any) { this._addTags([selectedItem]); this.tagInputElement.nativeElement.focus(); } @@ -264,7 +264,7 @@ export class TagInputComponent implements ControlValueAccessor, OnDestroy, OnIni addedTags.forEach(tag => this.addTag.emit(tag)); } - private _emitTagRemoved(removedTag): void { + private _emitTagRemoved(removedTag: any): void { this.removeTag.emit(removedTag); }