我正在获取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