2

I have the following:

<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>

Is there a way for me to change it so the street column becomes visible only if the option.selectedValue is equal to 0

4

2 に答える 2

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

于 2013-08-04T17:44:17.360 に答える