ng-bs-toast-service
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

NgBsToastService

Toast Service for Angular and Bootstrap 5.

Getting started

Step 1: Install ng-bs-toast-service

NPM

npm install --save ng-bs-toast-service

YARN

yarn add ng-bs-toast-service

Step 2: Import the NgBsToastServiceModule

import { NgBsToastServiceModule } from 'ng-bs-toast-service';

@NgModule({
  declarations: [...],
  imports: [NgBsToastServiceModule],
  bootstrap: [...]
})
export class AppModule {}

Step 3: Add ng-bs-toast-service tag

Add in app-component.html

<ng-bs-toast-service></ng-bs-toast-service>

Usage

Data source:

constructor(private toastService: NgBsToastService) {}

showToast() {
    this.toastService.send('Titulo 1', 'Message 1', 'primary');
}

In template:

<button type="button" class="btn btn-primary" (click)="showToast()">Show Toast</button>

Interfaces

ToastService.send(title: string, message: string | null, style?: 'success' | 'warning' | 'danger' | 'primary')

Readme

Keywords

none

Package Sidebar

Install

npm i ng-bs-toast-service

Weekly Downloads

0

Version

0.0.1

License

none

Unpacked Size

50.6 kB

Total Files

16

Last publish

Collaborators

  • alvinkalango