javascript - AngularJS: Infinite scroll w/ <table> -


I have infinite scroll work / a set of data is fine when I use a similar function using an HTML table ( Image index), the loader () function is being called very often, usually a light scroll will go through the entire set of data. Google did not give me a specific example to use the table, so I wonder if I am doing something wrong.

  & lt; Table & gt; & Lt; Span infinite-scroll = "loadMore ()" infinite-scroll-distance = '2' infinite-scroll-disabled = "load_diver" & gt; & Lt; Tr data-ng-repeat = "row in data" & gt; & Lt; Td data-ng-repeat = "item in line" & gt; & Lt; Div class = "image_box" & gt; & Lt; Img data-ng-src = "{{item.thumb_src}}" & gt; & Lt; Br> {{Item.title_eng}} & lt; / Div & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Span & gt; & Lt; / Table & gt; JavaScript  

Note that $ scope.data is an array of arrays of my items $ Scope.data [0] will have 5 items, which will have thumbnails and a little text.

  Angular Modules ('myApp', ['ngRoute', 'infinite-scroll']). Controller ("$ scope", ['$ scope', '$ http', '$ routeParams', '$ rootElement', '$ location', function ($ scope, $ http, $ routeParams, $ rootElement, $ location) { $ Scope.data = new array (); for line = -1; (var i = 0; i & lt; 100; i ++) {if (i% 5 == 0) {row ++; $ scope .data [row] = new array ();} var item = []; item ["title_eng"] = "title" + i; $ scope.data [line]. Push (item);} console.log (" We found "+ Row + 1 +" rows. "); $ Scope.rows = New Array (); var row_ix = 0; $ scope.loadMore = function () (if (! $ Scope.data [row_ix] | |! $ Scope.data [row_ix] .length) {return;} var x = 1; // 1 console.log at a time ("row_ix:" + row_ix + "."); (Var i = 0; i & Lt; x; i ++) {$ Scope.rows [row_ix] = new array (); $ scope.r Ows [row_ix] = $ scope.data [row_ix] .slice (0); row_ix ++;}} Angular.module ('infinite-scroll') Value ('THROTTLE_MILLISECONDS', 250); \  

Edit: It's coming back after some time. Throttle is not working: (


Comments