hi, I'm trying to write a condition which involves multiple checks step by step , can anyone help me simplifying my code , i tired to use ternary operations but failed so i made them a nested condition
if (this.remark.valid) {
if (this.remark.value.id == 5) { //only if remark is valid then this should be checked
if (this.other_reasons.valid) { //only if remark id is 5 then this should be checked
console.log('valid other reason');
}
} else { // if remark id not equal to 5
console.log('valid', this.remark.value.id, this.other_reasons.valid);
}
this.dialogRef.close();
}