Skip to content

Commit

Permalink
feat(theme-shared): add clear toasts by key functionality
Browse files Browse the repository at this point in the history
related issue: #2537
  • Loading branch information
thediaval committed Jan 9, 2020
1 parent ee4e0d9 commit 72fee03
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class ToasterService {
message,
title,
severity,
options: { closable: true, ...options, id },
options: { closable: true, id, ...options },
});
this.toasts$.next(this.toasts);
return id;
Expand All @@ -89,8 +89,8 @@ export class ToasterService {
/**
* Removes all open toasts at once.
*/
removeAll() {
this.toasts = [];
clear(key?: string) {
this.toasts = !key ? [] : this.toasts.filter(toast => toast.options.containerKey !== key);
this.toasts$.next(this.toasts);
}
}

0 comments on commit 72fee03

Please sign in to comment.