3
我有一個JSON對象從我的API返回這樣綁定JSON對象數組中Angular2查看nativescript
{
"ID": "GM5VY",
"Passengers": [
{
"Firstname": "TEST",
"Lastname": "TRAVELLER",
"TotalCount": "1",
FqtT": [
{
"MembershipID": "XXXXXX"
}
],
"Errors": null,
"Information": null,
"Warnings": null
}
],
"Errors": null,
"Information": null,
"Warnings": null
}
我使用管道過濾器此對象轉換爲一個數組,並試圖顯示乘客名字在視圖。但我無法檢索
<StackLayout *ngFor=" let passengerls of PassengerDetails | objtoarray; let i = index">
<Label [text]="passengerls?.value?.Passengers ? passengerls?.value?.Passengers[i].Firstname:null"> </Label>
</StackLayout>
請幫我達到這個!!!
顯示您的管道實現? – pixelbits
你可以設置一個示例plunkr –