大家好,我正在嘗試綁定angulajs中的表。我從表中的數據庫獲取數據並試圖填充該表。 在這裏,我做了表未在angularjs中綁定
$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' –