0
我有形式轉換一個JsonString到angular.js陣列
[{
"mileage": 12033,
"name": "Ford",
"model": "Focus",
"engine": "3 gophers on a treadmill",
"color": "green"
}, {
"mileage": 85000,
"name": "Chevy",
"model": "mailbu",
"engine": "6 cylinder",
"color": "Maroon"
}, {
"mileage": 612033,
"name": "Ford",
"model": "F150",
"engine": "6 cylinder",
"color": "Green"
}, {
"mileage": 89500,
"name": "Pontiac",
"model": "G6",
"engine": "2 cylinder",
"color": "Blue"
}, {
"mileage": 17200,
"name": "Pontiac",
"model": "G8",
"engine": "3 cylinder",
"color": "Silver"
}, {
"mileage": 308,
"name": "Toyota",
"model": "Forerunner",
"engine": "6 cylinders",
"color": "Grey"
}, {
"mileage": 65328,
"name": "Volvo",
"model": "wagon",
"engine": "8 cyclinders while not in test mode otherwise 2 bicycle pedals",
"color": "Red"
}, {
"mileage": 50,
"name": "IKea",
"model": "Ronde",
"engine": "3 self propelled coasters",
"color": "wood panelling"
}, {
"mileage": 17200,
"name": "Pontiac",
"model": "Grand Am",
"engine": "8 cylinder",
"color": "rusty"
}]
的JsonString有人可以幫我轉換這個字符串成angular.js數組。我試圖做幾個小時,最後不得不放棄。在此先感謝
的可能的複製[如何在Javascript解碼JSON?](http://stackoverflow.com/questions/13817445/how-to-decode-json-in-javascript) – n00dl3
,你可以使用'JSON。解析'得到一個字符串數組。 –
它已經是一個數組 – Satpal