Skip to content

Commit

Permalink
fix(typeahead): use TypeaheadMatch model instead of any type
Browse files Browse the repository at this point in the history
  • Loading branch information
mixomat authored and valorkin committed Oct 7, 2016
1 parent 80fccab commit ff5c219
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions components/typeahead/typeahead-container.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export class TypeaheadContainerComponent {
}
}

protected selectActive(value:any):void {
protected selectActive(value:TypeaheadMatch):void {
this.isFocused = true;
this._active = value;
}
Expand Down Expand Up @@ -181,11 +181,11 @@ export class TypeaheadContainerComponent {
this.isFocused = false;
}

public isActive(value:any):boolean {
public isActive(value:TypeaheadMatch):boolean {
return this._active === value;
}

private selectMatch(value:any, e:Event = void 0):boolean {
private selectMatch(value:TypeaheadMatch, e:Event = void 0):boolean {
if (e) {
e.stopPropagation();
e.preventDefault();
Expand Down
4 changes: 2 additions & 2 deletions components/typeahead/typeahead.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ export class TypeaheadDirective implements OnInit {
}
}

public changeModel(value:any):void {
let valueStr:string = TypeaheadUtils.getValueFromObject(value, this.typeaheadOptionField);
public changeModel(match:TypeaheadMatch):void {
let valueStr:string = match.value;
this.ngControl.viewToModelUpdate(valueStr);
(this.ngControl.control as FormControl).setValue(valueStr);
this.hide();
Expand Down

0 comments on commit ff5c219

Please sign in to comment.