I have a checkbox based on selecting the checkbox, the values must be shown in the dropdown. But here, when i "unselect" both the checkboxes and again select both and "unselect" one, then the dropdown values remains same, it doesn't reset. Can anyone help me to sort out this?
Ts:
setFaxId(index: number, faxQue: any) {
faxQue.isChecked = (faxQue.isChecked) ? false : true;
let filteredArr = this.faxqueuelists.filter(x=>x.faxQueueID == faxQue.faxQueueID);
if (faxQue.isChecked) {
this._selectedFaxQueList.push(faxQue.faxQueueID);
this.dropDownFaxQueueList.push(filteredArr[0]);
if(this.dropDownFaxQueueList.length == 1){
this.userGroup.get("DefaultFaxQueue").patchValue(faxQue.faxQueueID);
}
} else {
this._selectedFaxQueList.splice(this._selectedFaxQueList.indexOf(faxQue.faxQueueID), 1);
this.dropDownFaxQueueList.splice(this._selectedFaxQueList.indexOf(faxQue.faxQueueID),1);
this.userGroup.get("DefaultFaxQueue").patchValue("");
}
}