Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
Select2 with Angular works slow with more than 1500 data size

I am using select2 with Angular. I've got a lot of results (about 5k) opening select box is quite slow.

This is my component

    ngAfterViewInit(): void {
    
        $('#carrierSelector').select2({
    
          matcher: (params, data) => {
    
            const { value } = data.element;
            let filter:string = String(params.term).toLowerCase();;
            const { Name, CarrierId, CarrierName } = this.carriers.find((item:ICarrier) => item.index === parseInt(value));
    
            // If there are no search terms, return all of the data
            if ($.trim(params.term) === '') {
              return data;
            }
    
            if (Name.toLowerCase().indexOf(filter) > -1 ||
                CarrierId.toLowerCase().indexOf(filter) > -1 ||
                CarrierName.toLowerCase().indexOf(filter) > -1) {
    
                let modifiedData = $.extend({}, data, true);
                return modifiedData;
    
            }
    
            // Return `null` if the term should not be displayed
            return null;
    
          }
    
        });
    }

I tried a lot of ways like ajax, but it doesn't work for me

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!