我嘗試它包含以下JSON響應排序依據單JSON對象NG重複
{
"Title": "Harry Potter and the Sorcerer's Stone",
"Year": "2001",
"Rated": "PG",
"Released": "16 Nov 2001",
"Runtime": "152 min",
"Genre": "Adventure, Family, Fantasy",
"Director": "Chris Columbus",
"Writer": "J.K. Rowling (novel), Steve Kloves (screenplay)",
"Actors": "Richard Harris, Maggie Smith, Robbie Coltrane, Saunders Triplets",
"Plot": "Rescued from the outrageous neglect of his aunt and uncle, a young boy with a great destiny proves his worth while attending Hogwarts School of Witchcraft and Wizardry.",
"Language": "English",
"Country": "UK, USA",
"Awards": "Nominated for 3 Oscars. Another 15 wins & 58 nominations.",
"Poster": "http://ia.media-imdb.com/images/M/MV5BMTYwNTM5NDkzNV5BMl5BanBnXkFtZTYwODQ4MzY5._V1_SX300.jpg",
"Metascore": "64",
"imdbRating": "7.4",
"imdbVotes": "344,737",
"imdbID": "tt0241527",
"Type": "movie",
"Response": "True"
}
我遍歷鍵和下方值碼:
<div class="card" ng-repeat="(key,value) in movie">
<div class="item item-divider positive">
{{ key }}
</div>
<div class="item item-text-wrap">
{{ value }}
</div>
</div>
這是導致項目以按鍵[演員,獎項...]的升序顯示。如何在不更改訂單的情況下顯示它?
所以這將是你的標準進行排序? – meriadec 2014-09-25 13:41:33
[ng-repeat指令在使用(key,value)時對數據進行排序的可能的重複](http://stackoverflow.com/questions/19676694/ng-repeat-directive-sort-the-data-when-using-key - 值) – sma 2014-09-25 13:44:56
@meriadec按鍵在json對象的響應中設置的順序:「標題」,「年」,「額定」等。這是一個有趣的問題,我從來沒有遇到過像這之前 – Josep 2014-09-25 13:44:58