【发布时间】:2019-11-21 11:51:18
【问题描述】:
在选定的下拉列表更改值后尝试获取表的第一列 td 值但不起作用。 我想在角度 6 中选择下拉列表后获取第一列 td 值。 我在下面给出了我的代码。任何人都可以有想法吗?请帮助找到解决方案。
<table class="table table-striped table-hover" id="wrapperTbl">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Job</th>
<th>YearJoined</th>
<th>Missions</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let astronaut of astronautsToBeSelected" class="clickable">
<td (click)="selectAstronaut(astronaut)">{{astronaut.id}}</td>
<td (click)="selectAstronaut(astronaut)">{{astronaut.name}}</td>
<td (click)="selectAstronaut(astronaut)">{{astronaut.job}}</td>
<td (click)="selectAstronaut(astronaut)">{{astronaut.year_joined}}</td>
<select (change)="selected()">
<option *ngFor="let mission of astronaut.missions" [selected]="mission.name == 'back'">{{mission}} </option>
</select>
</tr>
</tbody>
【问题讨论】:
标签: angular6 angular7 angular8