我正在獲取JSON數據,並將JSON數據存儲在我的財產上。如何在角度2中動態設置表頭?
this.ResultData_search=data.json().extras.ResultData
this.ResultData=[
{
"First_name": "xx",
"Email": "xxxx",
"Phone": "xxx",
"countryCode": "+91",
"order_datetime": "xxx",
"status": 11,
"DeviceType": 3,
"orderId": "59081a04c9ff6852a49dd32a",
"orderseqId": "E00002347",
"orderType": 1,
"CustomerID": "xx",
"pickAddress": "xx",
"dropAddress": "xx",
"pickLatitude": 17.4369414,
"dropLatitude": 17.43673,
"dropLongitude": 78.36710900000003,
"paymentType": 2,
"itemDescription": "",
"receiverName": "uday",
"receiverPhone": "xx",
"itemName": "sanjay",
"deliverycharge": "199",
"bookingType": 1
}
}]
我想設置所有的鍵作爲表標題和數據作爲錶行。我提到了下面的鏈接https://stackoverflow.com/questions/40713580/angular2-table-with-dynamic-rows-and-columns
鏈接2:Dynamically loading columns and data in to table in Angular 2
任何plunker將是對我很大的幫助。
你到目前爲止嘗試過什麼? – mxr7350
我創建了一個管道,但它只是在tr中打印表格標題 – harish