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
>
>  <tr dir-paginate="user in Results| filter: vm.searchKeyword  
> |orderBy:orderByField:vm.reverseSort| itemsPerPage:30" 
> current-page="vm.current_page">
>
> Here is the search input
>
>  <input type="text"  ng-change="vm.SomeTask()"  ng-model="vm.searchKeyword" />
>
>
>
>
I think something like a debounce 
<https://docs.angularjs.org/api/ng/directive/ngModelOptions#triggering-and-debouncing-model-updates>
 
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:

 <input type="text"  ng-change="vm.SomeTask()"  ng-model="vm.searchKeyword" 
ng-model-options="{debounce: 500}"/>


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.

Reply via email to