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:

enter image description here

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:

http://jsfiddle.net/tcvhn/49/


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -