我想用HTML數據和預期輸出格式使用角度js在HTML中打印表格。你們能幫我解決問題嗎?嵌套json值的角度js ng-repeat
<table ng-app="testApp" ng-controller="testController">
<tr ng-repeat-start="test in testData">
<td rowspan="{{ test.data.length }}">{{ test.timeline }}</td>
<td>{{ test.data[0] }}</td>
</tr>
<tr ng-repeat-end ng-repeat="value in test.data.slice(1)">
<td>{{ value }}</td>
</tr>
angular.module('testApp',[])
.controller('testController',function($scope){
$scope.testData=[{
"timeline": "2017 - 05 - 23 T10: 09: 06.896 Z ",
data: [{
"story ": "Update ",
"component ": "Component 1"
}, {
"story ": "Update 2 ",
"component ": "Component 2"
}]
}, {
"timeline": "2017 - 05 - 23 T10: 09: 06.896 Z ",
data: [{
"story ": "Update",
"component ": "Component 3 "
}, {
"story ": "Update 2 ",
"component ": "Component 2"
}]
}];
});
沒有它不工作 – Shankar
@Shankar我忘了現在加入'.data'檢查 – abdoutelb