Skip to content

Commit

Permalink
fix(typeahead): avoid unecessery re-creation of DOM nodes
Browse files Browse the repository at this point in the history
Reverts part of #1612
Fixes #1659

Closes #1674
  • Loading branch information
pkozlowski-opensource committed Jul 11, 2017
1 parent fd04a83 commit 0c19153
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/typeahead/typeahead-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface ResultTemplateContext {
(mouseenter)="markActive(idx)"
(click)="select(result)">
<ng-template [ngTemplateOutlet]="resultTemplate || rt"
[ngOutletContext]="_getResultContext(result)"></ng-template>
[ngOutletContext]="{result: result, term: term, formatter: formatter}"></ng-template>
</button>
</ng-template>
`
Expand Down Expand Up @@ -79,8 +79,6 @@ export class NgbTypeaheadWindow implements OnInit {

@Output('activeChange') activeChangeEvent = new EventEmitter();

_getResultContext(result: any) { return {result: result, term: this.term, formatter: this.formatter}; }

getActive() { return this.results[this.activeIdx]; }

markActive(activeIdx: number) {
Expand Down

0 comments on commit 0c19153

Please sign in to comment.