Skip to content

Commit ff5c219

Browse files
mixomatvalorkin
authored andcommitted
fix(typeahead): use TypeaheadMatch model instead of any type
1 parent 80fccab commit ff5c219

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

components/typeahead/typeahead-container.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class TypeaheadContainerComponent {
142142
}
143143
}
144144

145-
protected selectActive(value:any):void {
145+
protected selectActive(value:TypeaheadMatch):void {
146146
this.isFocused = true;
147147
this._active = value;
148148
}
@@ -181,11 +181,11 @@ export class TypeaheadContainerComponent {
181181
this.isFocused = false;
182182
}
183183

184-
public isActive(value:any):boolean {
184+
public isActive(value:TypeaheadMatch):boolean {
185185
return this._active === value;
186186
}
187187

188-
private selectMatch(value:any, e:Event = void 0):boolean {
188+
private selectMatch(value:TypeaheadMatch, e:Event = void 0):boolean {
189189
if (e) {
190190
e.stopPropagation();
191191
e.preventDefault();

components/typeahead/typeahead.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ export class TypeaheadDirective implements OnInit {
175175
}
176176
}
177177

178-
public changeModel(value:any):void {
179-
let valueStr:string = TypeaheadUtils.getValueFromObject(value, this.typeaheadOptionField);
178+
public changeModel(match:TypeaheadMatch):void {
179+
let valueStr:string = match.value;
180180
this.ngControl.viewToModelUpdate(valueStr);
181181
(this.ngControl.control as FormControl).setValue(valueStr);
182182
this.hide();

0 commit comments

Comments
 (0)