我得到這個json對象數組在我的$ http.get響應。我想要顯示兩個json對象中的任何一個。如何訪問數組中的單個json對象?
// HTML代碼:
<pre ng-repeat="opportunity in opportunities track by $index">
<span>{{opportunity | json}}</span>
</pre>
JSON對象數組中的:在同一陣列
[
{
"type": "job",
"userId": "5791a4cd0a53c59c52fc3230",
"positionName": "aaaaaaaa",
"budget": "3",
"jobLocation": [
"Bangalore",
"Pune"
],
"minExp": "0 year",
"maxExp": "2 years",
"gradMarks": null,
"hscOrDiploma": null,
"ssc": null,
"jobDescription": "qq",
"selectionProcess": "cv",
"lastDate": "2016-07-30T18:30:00.000Z",
"noOfPositions": "9"
},
//第二JSON對象
{
"type": "job",
"userId": "5791a4cd0a53c59c52fc3230",
"positionName": "zz",
"budget": "3",
"jobLocation": [
"Bangalore",
"Chennai",
"Pune",
"Hyderabad",
"Mumbai",
"Gurgaon"
],
"minExp": "2 years",
"maxExp": "5 years",
"gradMarks": null,
"hscOrDiploma": null,
"ssc": null,
"jobDescription": "ss",
"selectionProcess": "aa",
"lastDate": "2016-07-30T18:30:00.000Z",
"noOfPositions": "5"
}
]
以上是我在做什麼。請幫幫我。
爲什麼喲你的意思是兩者中的任何一個?你有什麼標準嗎? –
請遵循StackOverflow風格指南。我剛剛格式化了你的問題,你花了一秒鐘再次刷新它.http://stackoverflow.com/help/formatting –
請通過上述鏈接中提到的格式指南,並相應地修改你的問題。我回滾了我最後一次編輯。 –