===================
This project was generated with Angular CLI version 6.2.3.
The lib is inspired by [angular-toastr] (https://github.com/Foxandxss/angular-toastr), and will show bootstrap-like toasts.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Run ng generate component component-name
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module
.
Run ng build
to build the project. The build artifacts will be stored in the dist/
directory. Use the --prod
flag for a production build.
Run ng test
to execute the unit tests via Karma.
Run ng e2e
to execute the end-to-end tests via Protractor.
By default, the toastr will show up at top right corner of the page view, and will automatically dismiss in 3 seconds. You can configure the toasts using ToastOptions class. Currently we support following options:
Determines how long an auto-dismissed toast will be shown. Defaults to 3000 miliseconds.
Determines whether toast should dismiss itself. If false, the toast will be dismissed when user tap on toast. Defaults to true.
Determines maximum number of toasts can be shown on the page in the same time. Defaults to 5.
Determines where on the page the toasts should be shown. Here are list of values:
- toast-top-right (Default)
- toast-top-center
- toast-top-left
- toast-top-full-width
- toast-bottom-right
- toast-bottom-center
- toast-bottom-left
- toast-bottom-full-width
CSS class for message within toast.
CSS class for title within toast.
Use Angular dependency inject for custom configurations. Here is code when you bootstrap your app:
import {provide} from 'angular2/core';
import {ToastOptions} from "ng2-toastr/ng2-toastr";
let options = {
autoDismiss: false,
positionClass: 'toast-bottom-right',
};
bootstrap(AppComponent, [
... ,
provide(ToastOptions, { useValue: new ToastOptions(options)}),
]);