From 8e6404cb474fb95b63c446458d681ccce51d89ec Mon Sep 17 00:00:00 2001 From: Stabzs Date: Sat, 4 Jun 2016 14:14:04 -0600 Subject: [PATCH] docs(README): documented toasterService.clear Added documentation for the clear function in toasterService in response to https://github.com/Stabzs/Angular2-Toaster/issues/28. --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7daafbb6..3db80a3a 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ bootstrap(Root); ``` ## Asynchronous vs Synchronous ToasterService -ToasterService exposes both a synchronous and asynchronous pop method in the form of `pop()` and +`ToasterService` exposes both a synchronous and asynchronous pop method in the form of `pop()` and `popAsync()` respectively. `pop()` returns a concrete `Toast` instance after the toastId property has been hydrated and the @@ -141,6 +141,20 @@ this.toasterService.pop(toast); ``` +## Clear Existing Toast +`ToasterService` exposes a `clear` function that accepts two optional parameters: `toastId` and +`toastContainerId`. + +These parameters can be used to clear toasts by specific id, by container id, +by both, or by neither. If both parameters are omitted, all toasts in all containers will be +removed. + +```typescript +var toast = this.toasterService.pop('success', 'title', 'body'); +this.toasterService.clear(toast.toastId, toast.toastContainerId); +``` + + ## Configurable Options ### Limit