ngTable嵌套字段

时间:2014-11-24 13:27:10

标签: angularjs ngtable

我看过this question并且解决方案非常简单,但是this plunker似乎不适用于我在项目中使用的Angular 1.33。

以下是问题的the same plunker(仅将Angular更新为版本1.33)。

HTML

  <table ng-table="tableParams" show-filter="true" class="table">
    <tr class='listing' ng-repeat="invoice in $data">
      <td data-title="'Invoice No.'" sortable="'no'" filter="{'no':'text'}">
        {{invoice.no}}
      </td>
      <td data-title="'Date'" sortable="'date'" filter="{'date':'text'}">
        {{invoice.date}}
      </td>
      <td data-title="'Client'" sortable="'client.fullname'" filter="{'client.fullname':'text'}">
        {{invoice.client.fullname}}
      </td>
    </tr>
  </table>

1 个答案:

答案 0 :(得分:1)

使用排序和过滤器,ngtable 0.3.1 - plunk

<table ng-table="tableParams" show-filter="true" class="table">
    <tr class='listing' ng-repeat="invoice in $data">
      <td data-title="'Invoice No.'" sortable="'no'" filter="{'no':'text'}">
        {{invoice.no}}
      </td>
      <td data-title="'Date'" sortable="'date'" filter="{'date':'text'}">
        {{invoice.date}}
      </td>
      <td data-title="'Client'" sortable="'client.fullname'" filter="{'client':'text'}">
        {{invoice.client.fullname}}
      </td>
    </tr>
  </table>