-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Description
Bug, feature request, or proposal:
Bug
What is the current behavior?
Subscribing to onAction()
will result in a subscription that never completes unless the action button is clicked.
Expected behavior
onAction()
completes when the snackbar ref is destroyed, I suppose in _finishDismiss()
.
Reproduction
https://stackblitz.com/edit/angular-material2-issue-l1ymh2?file=app/app.component.ts
Motivation
I wish to open a snack-bar that has a duration longer than the expected lifetime of the component opening it. When the action is clicked, I would like to navigate to a new route.
I am unable to unsubscribe from the subscription in ngOnDestroy
since the snackbar action may be available after the component is destroyed.
Metadata
Metadata
Assignees
Labels
No labels