の取り扱い JSON次のように私はJSONレスポンスを持っている:テーブル内のJSONレスポンス
var res = {
"response": {
"status": {
"code": "0",
"message": "Success"
},
"service": {
"servicetype": "3",
"functiontype": "3000",
"session_id": "966"
},
"data": {
"profilesearchsnippet": [
{
"profileInfo": {
"firstname": "Archita",
"lastname": "v",
"gender": "female",
"country": "India",
}
},
{
"profileInfo": {
"firstname": "Archita",
"lastname": "V",
"gender": "female",
"country": "India",
}
},
{
"profileInfo": {
"firstname": "Jayasree",
"lastname": "Salavadi",
"gender": "female",
"country": "Afghanistan",
}
},
{
"profileInfo": {
"firstname": "Kalai",
"lastname": "Sundar",
"gender": "female",
"country": "India",
}
},
{
"profileInfo": {
"firstname": "Singer",
"lastname": "sing",
"gender": "female",
"country": "Afghanistan",
}
}
]
}
}
}
は、私はすべてのファーストネームを取得したい、table.Iにおける国の状態市は、変数var SearchData
に割り当てるprofilesearchsnippet値を試してみましたが、フェッチしてみてくださいprofileinfoを使用してfirstnameを作成します。私はどこかに援助が必要なものを紛失している。
HTML:
<tr ng-repeat= "item in searchData">
<td>{{searchData.profileInfo.firstname}}</td>
<td> {{searchData.profileInfo.country}}</td>
</tr>
JS:
var searchData = res.response.data.profilesearchsnippet;
それが機能していません。取得される値はありません –