Angular NgTable 分页不起作用

Angular NgTable pagination doesn't work

我想弄清楚我做错了什么,但找不到例子 使用新版本的 NgTable

我可以从 NgTable 获取重新加载和数组,但我的分页不起作用

由于某些内容已被弃用,因此无法找到处理新更改的方法。

这是 ng-table v 0.8.3

$scope.listaDetalleFactura = function () {
                var idFacturaDetalle = $routeParams.idFactura;
                $scope.detalleFacturas = "";
                $promesa = facturaService.getDetalleFacturaList(idFacturaDetalle);
                $promesa.then(function (datos) {
                    $scope.detalleFacturas = datos.data;
                    var data = datos.data;
                    $scope.tableParams = new NgTableParams({
                        page: 1,
                        count: 5
                    }, {
                        total: data.length,
                        getData: function (params) {
                            data = $scope.detalleFacturas;
                            params.total(data.length);
                            if (params.total() <= ((params.page() - 1) * params.count())) {
                                params.page(1);
                            }
                            return data.slice((params.page() - 1) * params.count(), params.page() * params.count());
                        }});
                });
            };

我的table:

<table ng-table="tableParams" style="margin-top: 10px;" 
                                       class="table-condensed table-bordered table-striped"                                   
                                       data-ng-init="listaDetalleFactura()"
                                       >
                                    <thead>
                                        <tr>
                                            <th style="width: 40px; text-align: center;">Id</th>
                                            <th style="width: 300px;">Descripcion</th>
                                            <th style="width: 30px; text-align: center;">Cantidad</th>
                                            <th style="width: 150px; text-align: center;">Precio por Unidad</th>
                                            <th style="width: 50px; text-align: center;">Descuento</th>
                                            <th style="width: 50px; text-align: center;">Total</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr ng-repeat="detalleFactura in detalleFacturas">
                                            <td style="text-align: center;">{{detalleFactura.idDetalleFactura}}</td>
                                            <td>{{detalleFactura.producto.descripcion}}</td>
                                            <td style="width: 30px; text-align: center;">{{detalleFactura.cantidadDetalle}}</td>
                                            <td style="width: 150px; text-align: center;">{{detalleFactura.producto.precioVenta}}</td>
                                            <td style="width: 50px; text-align: center;">{{detalleFactura.descuentoDetalle}}</td>
                                            <td style="width: 50px; text-align: center;">{{detalleFactura.totalDetalle}}</td>
                                        </tr>
                                    </tbody>
                                </table>

好吧,我感觉很蠢,很抱歉浪费了你的时间...希望这有一天会对某人有所帮助....

我的错误是 ng-repeat 而不是 detalleFacturas 我应该使用 $data

<tbody>
                                    <tr ng-repeat="detalleFactura in $data">
                                        <td style="text-align: center;">{{detalleFactura.idDetalleFactura}}</td>
                                        <td>{{detalleFactura.producto.descripcion}}</td>
                                        <td style="width: 30px; text-align: center;">{{detalleFactura.cantidadDetalle}}</td>
                                        <td style="width: 150px; text-align: center;">${{detalleFactura.producto.precioVenta}}</td>
                                        <td style="width: 50px; text-align: center;">{{detalleFactura.descuentoDetalle}}</td>
                                        <td style="width: 50px; text-align: center;">${{detalleFactura.totalDetalle}}</td>
                                    </tr>
                                </tbody>