我想用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