-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a `dismiss` method to the snack bar service, which dismisses the currently-open instance, mostly for convenience since the spec only allows one snack bar to open at a time.
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,6 +105,15 @@ export class MdSnackBar { | |
return simpleSnackBarRef; | ||
} | ||
|
||
/** | ||
* Dismisses the currently-visible snack bar. | ||
*/ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
crisbeto
Author
Member
|
||
dismiss(): void { | ||
if (this._openedSnackBarRef) { | ||
this._openedSnackBarRef.dismiss(); | ||
} | ||
} | ||
|
||
/** | ||
* Attaches the snack bar container component to the overlay. | ||
*/ | ||
|
@crisbeto Does we have any option to autohide snankbar on page change (router change)?