Angularjs ng表无法获取要加载的数据
我似乎无法让我的ng表运行。 我错误地说newParams.reload不是函数。 试着在网上找到一些东西,并对我的代码进行了一些调整,但似乎仍然无法让它正常工作Angularjs ng表无法获取要加载的数据,angularjs,ngtable,Angularjs,Ngtable,我似乎无法让我的ng表运行。 我错误地说newParams.reload不是函数。 试着在网上找到一些东西,并对我的代码进行了一些调整,但似乎仍然无法让它正常工作 (function () { "use strict"; angular .module("app.bridge") .controller("bridgeController", bridgeController); function bridgeController($s
(function () {
"use strict";
angular
.module("app.bridge")
.controller("bridgeController", bridgeController);
function bridgeController($scope, authService, bridgeService, briges, NgTableParams) {
$scope.isBridgeSelected = false;
$scope.bridgeModel = {}
$scope.selectedBridge = {}
$scope.bridgeDetails = {};
$scope.bridgeKeyValue = briges.data;
$scope.tableParams = new NgTableParams({
},
{
total: $scope.bridgeKeyValue.length,
getData: function () {
console.log("inside getData");
$scope.data = briges.data;
}
});
}
})();
我的HTML是这样的
<table ng-table="bridgeKeyValue" show-filter="true" class="table table-condensed table-bordered table-striped">
<tr ng-repeat="row in data">
<td data-title="' # '">{{$index + 1}}</td>
<td data-title="'Bridge Name'" filter="{BridgeName: 'text'}">{{row.Name}}</td>
</tr>
{{$index+1}}
{{row.Name}
我也看不到我的日志
你能告诉我正确的方向吗?我不确定在这一点上我做错了什么。
谢谢大家!
ng table=“bridgeKeyValue”
应该是ng table=“tableParams”
@AlonEitan谢谢!你完全正确ng table=“bridgeKeyValue”
应该是ng table=“tableParams”
@AlonEitan谢谢!你完全正确!