[AngularJS] Re: Search filter is too slow in angularjs with large dataset

2017-11-10 Thread Sander Elias
Hi Suhas,


Aside from the answer, Zlatko provided, add an index-by, that will speed up 
things. Also look into using one-time bindings 
.
 
For the calculation of the pagination, you need to create an intermediary 
variable to hold the result array.
Doing those 3 things, you should have more than enough speed.

the var can be created like:


Once that is done, you can calculate the pagination by using 
filteredResults.length

Regards
Sander



-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.


[AngularJS] Re: Search filter is too slow in angularjs with large dataset

2017-11-08 Thread Zlatko Đurić
Hi,

On Wednesday, November 8, 2017 at 5:51:39 AM UTC+1, Suhas Pansare wrote:
>
> I have AngularJs client application which displays data in table using 
> dir-paginate directive of dirPagination.js
>
>   current-page="vm.current_page">
>
> Here is the search input
>
>  
>
>
>
>
I think something like a debounce 

 
would help to avoid running the whole thing on ANY change. E.g. you mention 
deleting a word - let's say 6-character word, and then type a new name, 6 
more characters, that's 12 times running filter, sort, reverse, and then 
also rendering the whole thing.

So your input would become something like:

 


There, now your model update is only running every half a second. See if 
that helps, if not, there are more tricks to try.

 

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.