我将使用 ngTable,我是 AngularJS 的新手,我不知道问题出在哪里:-(
我的错误:
TypeError: undefined is not a function
at Object.InputController.$scope.tableParams.ngTableParams.getData
我的代码:
angular.module("kasseev", ["firebase","ngTable"]);
function InputController($scope, $firebase, ngTableParams) {
var BaseRef = "https://xxxxxxx/";
var FBBaseRef = new Firebase(BaseRef);
var KontenRef = FBBaseRef.child("/posten/konto");
$scope.getKonten = $firebase(KontenRef);
$scope.tableParams = new ngTableParams({
page: 1, // show first page
count: 10 // count per page
}, {
total: $scope.getKonten.length, // length of data
getData: function($defer, params) {
$defer.resolve($scope.getKonten.slice((params.page() - 1) * params.count(), params.page() * params.count()));
}
});