0
我有一個名爲ListA
的列表。我正在執行一些過濾器並保存在一個名爲filteredList
的新陣列中。在使用ng-repeat應用另一個過濾器之前保留過濾列表
<div ng-repeat="element in filteredList =(ListA| filter: {label:searchCategory.value} |filter:searchString)">
現在,我想用filteredList
來實現分頁。我已經使用splice(start, end)
實施了另一個頁面的分頁,其中我更新了start
和end
值以更新可見陣列。 將拼接添加到過濾器將改變我的filteredList
大小,我需要它來計算分頁的頁數。
我需要進入ng-repeat
會是這樣的
ng-repeat="element in newList.splice(start, end)" where `newList` without splice is essentially `filteredList`.
完美!我把它放在一個函數中,並呼籲模型更改。雖然稍有變化。我已經更新了答案。謝謝! – Swanidhi