1.0.13 • Published 4 years ago

bootstrap-toast v1.0.13

Weekly downloads
39
License
-
Repository
-
Last release
4 years ago

BootstrapToast for Angular 2+

Simple toast library for Angular 2+ with Bootstrap 4. See this demo and try options.

Requirements

Must be install the following npm packages:

  1. bootstrap

Installation

npm install --save bootstrap-toast

Import bootstrap-toast module your ngModule. Paste the following code the end of the app.component.html file:

<lib-bootstrap-toast [config]="config"></lib-bootstrap-toast>

The config parameter is optional but if you want to modify default config, you use the following format:

{
  "position": "top-right", // or top-left, bottom-left, bottom-right
  "autoclose": true, // true or false
  "delay": 3 // seconds
}

The following example shows how to create a toast notification programatically. The function returns Subject instance. If the notification has one or more buttons, you can subscribe this instance to catch button actions.

this.toast.create( {
  "title": "Message",
  "message": "This is Sparta!",
  "buttons": [
    {
      "label": "OK",
      "action": "ok",
      "class": "btn-primary"
    },
    {
      "label": "Cancel",
      "action": "cancel",
      "class": "btn-light"
    }
  ]
} ).subscribe(action => { ... })

Thats all.

1.0.13

4 years ago

1.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago