Asp MVC angularjs nested ng-repeat on a view using viewmodel



我有一些代码可以工作。

public class testViewModel
{
  public int Id {get;set;}
  public string TestName {get;set;}
  public List<string> SecurityName {get;set;}
}

我的观点有以下几点:

<table>
    <thead>
        <tr>
            <th>@Html.LabelFor(m => m.Id)</th>
            <th>@Html.LabelFor(m => m.TestName)</th>
            <th>@Html.LabelFor(m => m.SecurityName)</th>
        </tr>
    </thead>
    <tbody>
        <tr data-ng-repeat="(values, a) in approvalStreams" ng-include="getTemplate(a)"></tr>
    </tbody>
    <script type="text/ng-template" id="view">
        <td>{{a.Id}}</td>
        <td>{{a.TestNametd></td>
        <td>
             @*<table>
                 <tbody>
                     <tr ng-repeat="b in values">
                         <td>{{SecurityName}}</td>
                     </tr>
                 </tbody>
               </table>*@

             {{a.SecurityName}}
         </td>   
     </script>

我正在尝试做的是列出模型中的SecurityName集合。

如果我使用 {

{a.SecurityName}},这将呈现集合中的第一项,如果我使用表和嵌套的 ng-repeat,则表呈现为

<!-- ngRepeat: b in values -->

而不是作为所需的名称列表。

发现是模型。它只是发回一个收藏品,而不是全部。

最新更新