-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
It cannot close modal when I change a router #447
Comments
Hi @fuybooo: import { Component, OnDestroy } from '@angular/core';
import { NzModalService } from '../../../index.showcase';
@Component({
selector: 'app-your-component',
template: `
<button nz-button [nzType]="'primary'" (click)="showModalForComponent()">
<span>使用Component</span>
</button>
`
})
export class YourComponent implements OnDestroy {
_modal: any;
constructor(private modalService: NzModalService) {
}
showModalForComponent() {
this._modal = this.modalService.open({ ... });
}
ngOnDestroy() {
this._modal.destroy('onCancel')
}
}
ngOnDestroy() {
+ this._modal.destroy('onCancel')
}
|
Ok, thank you very much! |
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm submitting a...
Current behavior
step 1: open https://ng.ant.design/#/components/pagination
step 2: open https://ng.ant.design/#/components/modal
step 3: click button '使用component'
step 4: click browser's back button
step 5: check the page, the modal is still visible
Expected behavior
It likes bug #412
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: