테이블이 있습니다. 선택 상자에서 선택한 값에 따라 테이블을 필터링하고 싶습니다. 비교 값은 선택 상자의 {{pipe.pipe_id}} 및 표의 {{dimension.pipe_id}}입니다. 이것에 대한 간단한 해결책이 있다고 생각하십니까? 어떠한 제안?Angular JS, 선택 상자가있는 필터 테이블
Pipe:
<select id="select01">
<option ng-repeat="pipe in pipes">{{pipe.code}} - {{pipe.title_en}}</option>
</select>
<table class="table table-striped">
<thead>
<tr>
<th>Pipe</th>
<th>Size</th>
<th>Inner diameter</th>
<th>Outer diameter</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="dimension in dimensions" >
<td>{{dimension.pipe_id}}</td>
<td>{{dimension.nominalsize}}</td>
<td>{{dimension.innerdiameter}}</td>
<td>{{dimension.outerdiameter}}</td>
</tr>
</tbody>
</table>
선택 상자를 사용하면 ng-options을 사용하는 것이 가장 좋습니다. https://docs.angularjs.org/api/ng/directive/select – Jared