Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typeahead performance issue #637

Closed
fdu-axiometrics opened this issue Jun 22, 2016 · 1 comment
Closed

typeahead performance issue #637

fdu-axiometrics opened this issue Jun 22, 2016 · 1 comment

Comments

@fdu-axiometrics
Copy link

fdu-axiometrics commented Jun 22, 2016

typeahead setup

<input type="text" class="form-control" placeholder="Search for..." [typeahead]="getAsyncData(getContext())"(typeaheadOnSelect)="typeaheadOnSelect($event)" [(ngModel)]="searchTerm">

private getContext():any {
        return this;
    }

private getAsyncData(context:any):Function {

      return function ():Promise<Object[]> {
                return context.searchService.searchCompaniesByName(context.addCompaniesModalSearchTerm.trim()).toPromise();
            };
}

getAsyncData function would be constantly called as long as the page is open and no user interaction is on the page.

[Attached timeline results on chrome]

angular2_timeline

@Dinistro
Copy link
Contributor

This should be fixed with the new Observable implementation #584 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants