Skip to content

Commit

Permalink
docs(README): documented toasterService.clear
Browse files Browse the repository at this point in the history
Added documentation for the clear function in toasterService in response
to #28.
  • Loading branch information
Stabzs committed Jun 4, 2016
1 parent 98f2ddd commit 8e6404c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8e6404c

Please sign in to comment.