Angular Material Dialog not closing after navigation

后端 未结 5 2571
醉酒成梦
醉酒成梦 2021-02-20 09:43

I\'m working on an application that shows an overview of entities in a datatable. Every entity has linked entities that are shown as \'xxx linked entities\' in a column. When th

5条回答
  •  梦毁少年i
    2021-02-20 10:35

    I had this problem and I just fixed it now.

    you need to subscribe router events after creating the dialogRef object. you can check the code

    const dialogRef = this.dialog.open(MyComponent, {
      width: '380px',
      height: '320px',
    });
    this.router.events
     .subscribe(() => {
       dialogRef.close();
     });
    

提交回复
热议问题