我试图在我的选择选项列表中添加搜索过滤器,因为有许多选项,没有搜索的话,用户很难找到他想要选择的选项。
希望您能理解我,因为我的英语不好。
这是我的代码(只是我的表格的一部分)
<ng-container *ngFor="let menaceProcessus of menaceProcessusTab">
<tr>
<td colspan="4" bgcolor="#f1f1f1"><b>{{menaceProcessus?.processus?.nom}}</b></td>
</tr>
<ng-container *ngFor="let actif of menaceProcessus?.actifs">
<tr>
<td [rowSpan]="actif?.menaces?.length+1">{{actif?.actif?.nom}}</td>
</tr>
<ng-container *ngFor="let mnVuln of actif?.menaces">
<tr>
<td>{{mnVuln?.vulnerabilite?.nom}}</td>
<td>
<select class="form-control"
(change)="mnVuln?.menaceActif?.menace.id = $event.target.value;
updateMenaceProcessus()">
<option></option>
<option *ngFor="let menace of menaces"
[value]="menace.id"
[selected]="menace.id === mnVuln?.menaceActif?.menace.id">
{{menace.nom}}</option>
</select>
</td>
<td>
<input class="form-control"
type="text" [value]="mnVuln?.menaceActif?.probabilite">
</td>
</tr>
</ng-container>
</ng-container>
</ng-container>