Javascript 智能表在控制器中显示集合
我正在使用智能表,我想在控制器中获取displayedCollection的值Javascript 智能表在控制器中显示集合,javascript,angularjs,smart-table,Javascript,Angularjs,Smart Table,我正在使用智能表,我想在控制器中获取displayedCollection的值 <table id="oldUsersTable" st-table="displayedCollection" st-safe-src="allOldUsers" class="table table-striped"> <thead> <tr> <th class="table-width-auto">{{'oldUsers.tableTh_selected
<table id="oldUsersTable" st-table="displayedCollection" st-safe-src="allOldUsers" class="table table-striped">
<thead>
<tr>
<th class="table-width-auto">{{'oldUsers.tableTh_selected' | translate}}</th>
<th class="table-width-auto">{{'oldUsers.tableTh_firstName' | translate}}</th>
<th class="table-width-auto">{{'oldUsers.tableTh_lastName' | translate}}</th>
</tr>
<tr>
<th colspan="3">
<input class="form-control width-max" placeholder="{{'common.searchPlaceholder' | translate}}"
dom-search dom-search-timeout="800" dom-search-table-id="'oldUsersTable'" dom-search-page-size="pageSize"/>
</th>
</tr>
</thead>
<tbody>
<tr class="oldUsersTableTr" ng-repeat="row in displayedCollection" ng-class="selectedUserClass(row)" ng-click="selectUser(row)">
<td class="align-center">
<checkbox model="row.selected" classes="'margin-left-right-auto'"></checkbox>
</td>
<td>
{{row.firstName}}
</td>
<td>
{{row.lastName}}
</td>
<td style="width: 100px !important; height: 50px;">
<button class="btn btn-sm blue-steel oldUserDeleteButton" ng-click="deleteUser(row.uuid)">
{{'oldUsers.deleteUser' | translate}}
<i class="fa fa-trash-o"></i>
</button>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3" class="text-center">
<div id="oldUsersPagination" st-pagination="" st-template="templates/fragments/smartTablePagination.html" st-items-by-page="pageSize" st-displayed-pages="10"></div>
</td>
</tr>
</tfoot>
{{'oldUsers.tableTh_选择了{124; translate}}
{{'oldUsers.tableTh_firstName'| translate}
{{'oldUsers.tableTh_lastName'| translate}
{{row.firstName}
{{row.lastName}
{{'oldUsers.deleteUser'| translate}}
在控制器中,我尝试使用(根据此注释)获取displayedCollection:
$scope.displayedCollection
未定义
我已尝试实施此解决方案,但没有成功:
一个带示例的Plunker:
AngularJS v1.5和你好,月亮石,欢迎来到SO!要快速获得好的答案,您需要尽可能详细:添加代码的更多部分、您迄今为止所做的尝试、您试图实现的目标等。要更好地掌握提出好问题的方法,您可以参考:您好,安德鲁,谢谢您的帮助。我已经更新了问题。我希望现在更清楚了。