2
私のフォームでselect1とselect2を選択する選択肢がありますselect2はselect2の選択に依存しますselect2のselectの変更オプションはこの作業をうまく変更する必要がありますが、デフォルトのオプションに戻って、それは私に最後のselect2の選択の最後のインデックスを与える 私はselect2のオプションを変更し、選択したオプションのインデックスを0またはデフォルトのオプションに戻る 私はang2の選択を処理するために使用していますどのように角度2の選択をリセットする
この私のhtmlコード:
<td *ngIf="classificationCheck"><select name="classification_type" [(ngModel)]="message.classification_type"
class="form-control" [disabled]="isReply||isForward">
<option value="" disabled default>تصنيف موضوعي</option>
<option *ngFor= "let subType of classificationTypes">{{subType}}</option>
</select></td>
、これのonChange SELECT1魔女更新SELECT2オプション機能:
classificationChange(event){
if("غير محدد"==event){
this.classificationCheck=false;
this.message.classification_type=null;
}
else{
for(let classtype of this.classifications){
if(classtype.gen==event){
if(classtype.name)
{
this.classificationTypes=[];
this.classificationCheck=true;
for(let subType of classtype.name){
this.classificationTypes.push(subType);
}
}
}
}
}
}
コードを入力してください。そして句読点を使用してください、質問はほとんど読めません。 –
[pnlkr](https://plnkr.co/)を作成してください。質問を解読することは非常に困難です。 – sisyphus
私はコードで更新しました –