0

我有一些工作的代碼。Asp MVC angularjs在視圖中使用視圖模式嵌套ng-repeat

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重複,表格呈現爲

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

和不是所需的名單。

回答

0

發現它是模型。它只是發回其中一個集合,不是全部。