Skip to content

Commit

Permalink
feat: use individual options value for "newestOnTop" (#932)
Browse files Browse the repository at this point in the history
  • Loading branch information
jccint committed Oct 3, 2022
1 parent b765833 commit c86b7a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ Passed to `ToastrService.success/error/warning/info/show()`
| easing | string | 'ease-in' | Toast component easing |
| easeTime | string \| number | 300 | Time spent easing |
| enableHtml | boolean | false | Allow html in message |
| newestOnTop | boolean | true | New toast placement |
| progressBar | boolean | false | Show progress bar |
| progressAnimation | `'decreasing' \| 'increasing'` | 'decreasing' | Changes the animation of the progress bar. |
| toastClass | string | 'ngx-toastr' | Class on toast |
Expand Down Expand Up @@ -174,7 +175,6 @@ options:
| maxOpened | number | 0 | Max toasts opened. Toasts will be queued. 0 is unlimited |
| autoDismiss | boolean | false | Dismiss current toast when max is reached |
| iconClasses | object | [see below](#iconclasses-defaults) | Classes used on toastr service methods |
| newestOnTop | boolean | true | New toast placement |
| preventDuplicates | boolean | false | Block duplicate messages |
| countDuplicates | boolean | false | Displays a duplicates counter (preventDuplicates must be true). Toast must have a title and duplicate message |
| resetTimeoutOnDuplicate | boolean | false | Reset toast timeout on duplicate (preventDuplicates must be true) |
Expand Down
2 changes: 1 addition & 1 deletion src/lib/toastr/toastr.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export class ToastrService {
const toastInjector = Injector.create({providers, parent: this._injector});

const component = new ComponentPortal(config.toastComponent, toastInjector);
const portal = overlayRef.attach(component, this.toastrConfig.newestOnTop);
const portal = overlayRef.attach(component, config.newestOnTop);
toastRef.componentInstance = portal.instance;
const ins: ActiveToast<any> = {
toastId: this.index,
Expand Down

0 comments on commit c86b7a8

Please sign in to comment.