Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 为什么不是';是否为桌子工作?_Jquery_Angularjs_Infinite Scroll_Nginfinitescroll - Fatal编程技术网

Jquery 为什么不是';是否为桌子工作?

Jquery 为什么不是';是否为桌子工作?,jquery,angularjs,infinite-scroll,nginfinitescroll,Jquery,Angularjs,Infinite Scroll,Nginfinitescroll,我试图在我的表上使用ng repeat on实现ngInfiniteScroll,但是,当我到达页面末尾时,它不会被触发 <div infinite-scroll="list.getMoreItems()"> <table md-table md-row-select> <thead md-head> <tr md-row> <th md-column><

我试图在我的表上使用ng repeat on
实现ngInfiniteScroll,但是,当我到达页面末尾时,它不会被触发

<div infinite-scroll="list.getMoreItems()">
    <table md-table md-row-select>
        <thead md-head>
           <tr md-row>
                <th md-column><span>Id</span></th>
                <th md-column><span>Item</span></th>
            </tr>
        </thead>
       <tbody md-body ng-repeat="data in list.items">
           <tr md-row><td md-cell>{{data.title}}</td></tr>
           <tr md-row><td md-cell>Click here </td></tr>
       </tbody>
   </table>
</div>

身份证件
项目
{{data.title}
点击这里
My
getMoreItems()
现在只会抛出一个警报

ngInfiniteScroll的配置正确,因为它在页面加载时执行
getMoreItems()
,但此后不会执行。

在HTML中:

<tbody md-body ng-repeat="data in list.items | limitTo:barLimit">

基于此

问题在于视口滚动计算。从包含ng repeat的容器中删除
overflow-y:hidden
,解决了该问题

<div id="holdList" infinite-scroll="list.getMoreItems()">
    <table md-table md-row-select>
        <thead md-head>
           <tr md-row>
                <th md-column><span>Id</span></th>
                <th md-column><span>Item</span></th>
            </tr>
        </thead>
       <tbody md-body ng-repeat="data in list.items">
           <tr md-row><td md-cell>{{data.title}}</td></tr>
           <tr md-row><td md-cell>Click here </td></tr>
       </tbody>
   </table>
</div>


#holdList
{
   height: 100%;
   overflow: auto;
}

身份证件
项目
{{data.title}
点击这里
#保留名单
{
身高:100%;
溢出:自动;
}

你能给你看无限滚动指令代码吗?我可以帮你吗?@ManojPatidar我还没有做这个指令。我使用的是外部软件包-看起来您缺少了
无限滚动距离
(即
无限滚动距离=“3”
)@RaphaelRafatpanah说这是可选的<代码>无限滚动距离(可选)@AkshayKhetrapal请将控制器代码与任何其他部分一起发布到定义和使用
列表的位置。您是否使用“控制器作为”语法?谢谢。那。。。解决不了我的问题,马修。我在上面提到,
getMoreItems()
实际上并没有被触发。
<div id="holdList" infinite-scroll="list.getMoreItems()">
    <table md-table md-row-select>
        <thead md-head>
           <tr md-row>
                <th md-column><span>Id</span></th>
                <th md-column><span>Item</span></th>
            </tr>
        </thead>
       <tbody md-body ng-repeat="data in list.items">
           <tr md-row><td md-cell>{{data.title}}</td></tr>
           <tr md-row><td md-cell>Click here </td></tr>
       </tbody>
   </table>
</div>


#holdList
{
   height: 100%;
   overflow: auto;
}