我需要根據值對ng-repeat
中的$scope
對象進行排序。我可以通過自定義過濾器將它轉換爲array
,但只能將鍵或值推入array
。我需要這兩個鍵和值顯示它的UI:
$scope.list = {
test:58uy43: "test:one",
test:24ht76: "test:two",
test:26df90: "test:three",
test:39fg67: "test:four",
test:18ds65: "test:five"
}
<div ng-repeat="(key,value) in list">{{key}} : {{value}}</div>
請幫我在這
你最好有一個對象數組,我認爲 – k102
你可能會發現這個有用:http://stackoverflow.com/questions/14788652/how-to-filter-key-value-with-ng-repeat-in -angularjs – Filipe