yangular
yangular copied to clipboard
dialogRef.afterClose().toPromise() not working
Not able to convert afterClose() observable to promise.
Check here: https://stackblitz.com/edit/angular-material-animation-wkxojh?file=app/dialog-overview-example.ts Below code is not working as expected:
dialogRef.afterClosed().toPromise().then(() => {
alert('closed');
}).catch(() => {
alert('error');
});
Please check
@EzyHow if you take a look at library you need to use something like
this.dialogRef
.open(EditUserComponent, {
animation: { to: "left" },
role: "dialog",
})
.afterClosed()
.subscribe((arg) => {
console.log("Back from the dialog");
});
Updated example of @EzyHow https://stackblitz.com/edit/angular-material-animation-61jy9f?file=app/dialog-overview-example.ts
@yantrab
this npm is still maintainable?
The current Angular version is 13 though :-)
@yantrab this npm is still maintainable? The current Angular version is 13 though :-)
you can open PR, it is open source... :smiley: