angularjs - How to invalidate pagination total-items? -
i developing directive searching, different number of items in each search query, seems pagination directive not getting refreshed when has to, total-items locked "1" regardless of efforts change it:
here view:
<search-widgets> .. .. <pagination ng-model="currentpage" total-items="totalitems" max-size="maxsize" boundary-links="true"> </pagination> .. .. </search-widgets>
and here show search query results:
function show_search_results(searchresults){ scope.search_results= searchresults; // has no effect: scope.totalitems= scope.search_results.length; }
i tried use timer apply changes, pagination directive didn't updated
setinterval(function() { if(!scope.$$phase){ scope.$apply(); scope.$digest(); } }, 1000);
any 1 can help?
edit
here plunker make more clear:
Comments
Post a Comment