Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nz-modal 能否提供全局事件,如:closeAll #1162

Closed
realmx opened this issue Mar 17, 2018 · 2 comments
Closed

nz-modal 能否提供全局事件,如:closeAll #1162

realmx opened this issue Mar 17, 2018 · 2 comments
Assignees

Comments

@realmx
Copy link

realmx commented Mar 17, 2018

What problem does this feature solve?

当页面打开一个或多个modal时,用户点其它菜单或点击浏览器后退按钮,这些已打开的modal需要一次性全关闭掉

What does the proposed API look like?

希望提供一个closeAll事件,在根页面监听路由变化,可关闭所有modal,如下代码

    constructor(
        private router: Router,
        private modalService: NzModalService
    ) {
        router.events.subscribe(event => {
            if (event instanceof NavigationStart) {
                this.modalService.closeAll();
            }
        });
    }
@vthinkxie
Copy link
Member

@wilsoncook please take this into consideration in 0.7.0 version.

wilsoncook added a commit to wilsoncook/ng-zorro-antd that referenced this issue Mar 19, 2018
…adjust the boolean props and changeBodyOverflow, complete testing.

close NG-ZORRO#1162
wilsoncook added a commit to wilsoncook/ng-zorro-antd that referenced this issue Mar 19, 2018
…adjust the boolean props and changeBodyOverflow, complete testing.

close NG-ZORRO#1162
@lock
Copy link

lock bot commented Mar 19, 2019

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 19, 2019
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
…penModals, adjust the boolean props and changeBodyOverflow and complete testing. (NG-ZORRO#1165)

* feat(module:modal): add afterClose and more to improve communication capabilities

close NG-ZORRO#1155

* feat(module:modal): add afterOpen/afterAllClose/closeAll/openModals, adjust the boolean props and changeBodyOverflow, complete testing.

close NG-ZORRO#1162

* docs(changelog): add 0.7.0-beta.2 changelog for modal
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants