-1
嗨需要幫助如何使用angularjs將此數組值循環到3列。如何在angularjs中安排JSON值?
目前我的看法是這樣的 Html table contain 3 column the value showing in vertical instead of horizontal 下面是我的JSON視圖
{
"Table1": {
"titleList": [
"Table1",
"Start Date",
"Completion Date"
]
"dataList": [
{
"Name": "Ayu",
"startDate": "30 Jul 2015",
"completionDate": "30 Jul 2015"
}
],
},
"Table2": {
"titleList": [
"Table2",
"Start Date",
"Completion Date"
]
"dataList": [
{
"Name": "Siti",
"startDate": "",
"completionDate": ""
},
{
"Name": "wan",
"startDate": "",
"completionDate": ""
},
{
"Name": "nita",
"startDate": "",
"completionDate": ""
},
],
},
"Table3": {
"titleList": [
"HGA",
"Start Date",
"Completion Date"
]
"dataList": [
{
"Name": "Fatimah",
"startDate": "",
"completionDate": ""
},
{
"Name": "Nora",
"startDate": "",
"completionDate": ""
},
],
}
}
我angularjs顯示如下
<tbody ng-repeat ="(nodeSummaryKey, nodeSummaryVal) in nodeSummary">
\t \t \t \t \t \t
\t \t \t \t \t <tr ng-if="isObject(nodeSummaryVal)" ng-class-odd="'odd'" ng-class-even="'even'" ng-repeat = "(dataKey, dataValue) in nodeSummaryVal" >
\t \t \t \t \t \t <td ng-if="dataKey == 'titleList'" class="stx-attributes-group"
\t \t \t \t \t \t ng-repeat="(eachDataKey, eachDataValue) in nodeSummaryVal.titleList">{{eachDataValue}}</td>
\t \t \t \t \t \t
\t \t \t \t \t \t <td ng-if="dataKey == 'dataList'" ng-repeat="(eachDataKey, eachDataValue) in dataValue">
\t \t \t \t \t \t \t <div ng-repeat="(eachKey, eachValue) in eachDataValue">{{eachValue}}</div>
\t \t \t \t \t \t
\t \t \t \t \t </tr>
\t \t \t \t </tbody>
我需要幫助如何使價值爲1行顯示1列顯示所有數據列表值代替。提前致謝。 – Cput
你的json是不正確的 –
我已經添加了我的完整JSON結果..請幫助,如果它真的不正確的地方是不正確的?以及如何解決它?到目前爲止,我可以將我的restservice中的數據顯示給UI,只是它的順序不能顯示在列中顯示的行中 – Cput