Skip to content

Commit

Permalink
fix(typeahead): inside of onpush components (#2946)
Browse files Browse the repository at this point in the history
  • Loading branch information
valorkin authored Nov 2, 2017
1 parent 5986e51 commit 44763a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/typeahead/typeahead.directive.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* tslint:disable:max-file-line-count */
import {
ChangeDetectorRef,
Directive,
ElementRef,
EventEmitter,
Expand Down Expand Up @@ -138,7 +139,8 @@ export class TypeaheadDirective implements OnInit, OnDestroy {
private element: ElementRef,
viewContainerRef: ViewContainerRef,
private renderer: Renderer2,
cis: ComponentLoaderFactory) {
cis: ComponentLoaderFactory,
private changeDetection: ChangeDetectorRef) {
this._typeahead = cis.createLoader<TypeaheadContainerComponent>(
element,
viewContainerRef,
Expand Down Expand Up @@ -268,6 +270,7 @@ export class TypeaheadDirective implements OnInit, OnDestroy {
const valueStr: string = match.value;
this.ngControl.viewToModelUpdate(valueStr);
(this.ngControl.control).setValue(valueStr);
this.changeDetection.markForCheck();
this.hide();
}

Expand Down

0 comments on commit 44763a9

Please sign in to comment.