我有一个来自后端userList
的数据,但它没有在表格中显示任何想法使用ng-repeat
在下面的代码中实现了什么错误。
main.html中
<tr ng-repeat="user in userList track by $index">
<td st-ratio="20">{{user.attuid}}</td>
<td st-ratio="30">{{user.firstName}} {{user.lastName}}</td>
<td st-ratio="15" ng-bind-html="user.type"></td>
<td st-ratio="15">{{user.email}}</td>
<td st-ratio="20" class="text-right">
<button tooltip-placement="top" tooltip-popup-delay="300" uib-tooltip="Edit" type="button" ng-click="editUser($index, user)" class="btn btn-sm btn-secondary">
<i class="glyphicon glyphicon-pencil"></i>
</button>
<button tooltip-placement="top" tooltip-popup-delay="300" uib-tooltip="Delete" ng-disabled="currentUser.id === user._id" type="button" ng-click="deleteUser($index, user)" class="btn btn-sm btn-danger">
<i class="glyphicon glyphicon-remove-circle"></i>
</button>
</td>
</tr>
controller.js
$scope.userList = data
在控制台中打印数据
Array[1]
0
:
Object
__v
:
0
_id
:
"585419276bef8729e8e4d08e"
attuid
:
"sh89u"
email
:
"sh9829u@gmail.com"
firstName
:
"Syed"
lastName
:
"Hussain"