I have situation where I get from API String array of validation codes. Also I have mapper where I get description to code on front side.
Question is, there is possible to display material dialog after closing previous one?
My code:
.subscribe((res:string[]) => {
console.log("res: ", res);
let dialogRef: MatDialogRef<ValidationDialog>;
for (let i = 0; i < res.length; i++) {
const code = res[i];
const description = this.locale.getDescription(code);
let config = new MatDialogConfig();
config.data = {code: code, description: description.value};
console.log("dialogRef: ", dialogRef);
dialogRef = this.dialog.open(ValidationDialog, config);
console.log("--Dialog--");
console.log("Data: ", config.data, this.dialog);
dialogRef.afterClosed().subscribe(data => {
console.log("data returned from mat-dialog-close is ", data);
});
With if statement, where i check dialogRef, I get only one dialog, without it like in example, I have opened all dialogs in same time.
Please for advice,