【发布时间】:2017-04-22 13:31:52
【问题描述】:
大家好,我正在尝试在 angulajs 中绑定表格。我正在从表中的数据库获取数据并尝试填充该表。 在这里我做到了
$scope.getPageDetails = function () {
$http.get('/api/privilege/getpagedetails/')
.success(function (data, status) {
$scope.Page = data;
console.log($scope.Page);
}).error(function () {
});
}
然后我在定义为$scope.Page = []; 的 $scope.Page 中获取数据,这里我附上我在 $scope.page 中获取数据的控制台图像
这是我的桌子
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>
ID
</th>
<th>
PageName
</th>
<th>
PageUrl
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="Page in Pages">
<td>{{Page.id}}</td>
<td>{{Page.pageName}}</td>
<td>{{Page.pageUrl}}</td>
<td>
<input type="checkbox" value="Edit" />
</td>
</tr>
</tbody>
</table>
请在我想念的地方提供帮助,我将非常感谢你们。
【问题讨论】:
-
$scope.Page应该是$scope.Pages
标签: javascript jquery html angularjs ajax