HI, I am using below dummy json object:當我使用ngFor使用JSON對象
[
{
"username": "ramu",
"user_id": "222",
"profileImage": "ramu.jpg",
"status": "15",
"address": [
{
"type": "permanent",
"city": "mtm",
"pin": "521001",
"personal1": [
{
"age": "26",
"color": "white"
}
]
},
{
"type": "residential",
"city": "chennai",
"pin": "600024",
"personal2": [
{
"age": "26",
"color": "white"
}
]
}
]
}
]
and below i am using ngfor for getting iterating elements
<ion-item *ngFor="let item of profile.address">
{{item.type}}
</ion-item>
如何獲取地址類型,我沒有得到輸出filds?
是'profile'的json對象嗎? –
你是什麼意思?獲得地址類型:永久和個人年齡:26'? – SaiUnique
是的,profile是一個json對象@suraj –