From bfeb7f40f6f84ca381fa08c8939ce02c86d83ece Mon Sep 17 00:00:00 2001 From: davidv Date: Thu, 27 Aug 2020 09:34:58 +0200 Subject: [PATCH] Added method to close all opened toaster messages. --- src/toaster/toaster.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/toaster/toaster.ts b/src/toaster/toaster.ts index f18e9c4..8f094d8 100644 --- a/src/toaster/toaster.ts +++ b/src/toaster/toaster.ts @@ -74,4 +74,10 @@ export class Toaster { }, 500); } } + + public closeAll(): void { + this.notifications = []; + this.notifications$.next(this.notifications); + this.notificationsCount = 0; + } }