我想要绑定到一个数组内的数组。然后我想使用ng-repeat在空白div容器中显示第二个数组的所有“名称”项。我的代码如下所示:用一个Ng-Repeat绑定到一个阵列内的阵列
$scope.workflows = [{
Id: 1,
Name: "Name of first workflow(*don't want to repeat*)",
Description: "Education focus area requests",
Steps: [{
Id: 1,
Name: "**Name I DO Want to Repeat**",
Description: "The concept paper listed below",
Action: "Get Approval From",
Obj: "Program Officer - Group",
AdditionalInfo: "n/a",
}, {
Id: 2,
Name: "**Name I DO Want to Repeat**",
Description: "Describe",
Action: "Do things",
Obj: "n/a",
AdditionalInfo: "n/a",
}, {
Id: 3,
Name: "**Name I DO Want to Repeat**",
Description: "Describe",
Action: "Do things",
Obj: "n/a",
AdditionalInfo: "Additional",
},
]},
这是HTML
<div class="commentContainer" style="width: 100%">
<div class="textBlue" ng-repeat="workflow in selectedWorkflow track by $index" style="width: 100%; margin-top: 7px; margin-bottom: 5px">
{{selectedWorkflow.Name}}
</div>
</div>
(这是我选择的工作流程来源于)
$scope.selectedWorkflow = {};
$scope.selectWF = function(wf) {
$scope.selectedWorkflow = wf;
console.log(wf);
$scope.goAway = 1;
}
,我应该在我的NG-重复改变什么码并在我的绑定,来到我的第二个数组中的“名称”对象重复,而不是第一个数组中的“名称”对象?
非常感谢!我已经尝试了一切,但那和它工作!我在这个新的。谢谢! – Bradston07 2014-12-04 16:41:48