1.3.1 • Published 5 years ago

@hangar42/ngx-toast-it v1.3.1

Weekly downloads
1
License
GPL-3.0
Repository
github
Last release
5 years ago

ngxToastIt

ngxToastIt is a simple and lightweight Angular module providing Toasts for your application. Purely written in Angular 8 and designed by hand.

Just have a look at the Demo

toast examples

Installation

Install via NPM:
npm install @hangar42/ngx-toast-it

or manually download it.

Usage

1. Include ngxToastIt as a dependency in your desired module:
import {ToastItModule} from 'ngx-toast-it';
...
imports: [
  ToastItModule,
  ...
 ]
2. Inject ToastItService in any class of the module:
constructor(private toastItService: ToastItService){}
3. (Optional) Setup Config
 import {ToastConfig, ToastPosition} from 'ngx-toast-it';
 ...
 public toastConfig: ToastConfig = {
     position?: ToastPosition.topRight,
     groupingThreshold?: 5,
     progressBarEnabled?: true
 };
 
 public someFunction(){
   this.toastItService.setConfig(this.toastConfig);
 }
4. Create and fire Toast
import {Toast, ToastType} from 'ngx-toast-it';
...
public toast: Toast = {
    type: ToastType.success,
    heading: 'Great',
    subheading?: 'You found the Toast Component',
    message: 'Let us know what you like about it',
    timeout?: 0
  };
...
public someFunction(){
    this.toastItService.createToast(this.toast);
}

Development

  • Clone the repo or download it
  • Install dependencies: npm install
  • Run npm run build:library
  • Run ng serve

License

GPLv3 Link

Maintainers

1.3.1

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago

0.9.0

5 years ago