我有以下内容:
<select
data-ng-model="option.selectedValue"
data-ng-options="item.id as item.name for item in option.selects">
</select>
<table>
<thead>
<tr>
<th>Id</th>
<th>City</th>
<th>Street</th>
</tr>
</thead>
<tbody class="grid">
<tr data-ng-repeat="row in grid.data">
<td>{{ row.iD }}</td>
<td>{{ row.city }}</td>
<td>{{ row.street }}</td>
</tr>
</tbody>
</table>
我有办法更改它,这样只有当option.selectedValue
等于0
答案 0 :(得分:3)
在{{row.street}}
和street
行
<th ng-show='option.selectedValue == 0'>Street</th>
...
<td ng-show='option.selectedValue == 0'>{{row.street}}</td>
或
<th ng-hide="option.selectedValue != 0">Street</th>
...
<td ng-hide='option.selectedValue != 0'>{{row.street}}</td>
它是一样的;)
答案 1 :(得分:1)
使用ng-show。您需要隐藏header column
和content column
。
<th ng-show="option.selectedValue == 0">Street</th>
<td ng-show="option.selectedValue == 0">{{ row.street }}</td>
的 Demo 强>