@gavinb841/gb-alerts
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

What it is?

This is an alert library, it contains 4 types of alert messages.

  • Success (Green)
  • Danger (Red)
  • Warning (Orange)
  • Info (Blue)

Prerequisite

  1. "@angular/common": "^7.0.0",
  2. "@angular/core": "^7.0.0"
  3. Include the following in the head of your index.html to display font awesome ions:

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">

Installation

1. Run:

npm i @gavinb841/gb-alerts

2. Import GbAlertsModule into app.modules.ts

3. Importing service:

import { GbAlertsService } from '@gavinb841/gb-alerts';

4. Create instance of service:

constructor(private gbAlertsService: GbAlertsService)

5. Create methods to call alerts

Method Examples

Success Alert

public createSuccessAlert(): void { this.gbAlertsService.createSuccessAlert('Successfully Created'); }

Danger Alert

public createDangerAlert(): void { this.gbAlertsService.createDangerAlert('Danger Cannot Delete'); }

Warning Alert

public createWarningAlert(): void { this.gbAlertsService.createWarningAlert('Warning Do Not Refresh'); }

Info Alert

public createInfoAlert(): void { this.gbAlertsService.createInfoAlert('Include This Field'); }

Readme

Keywords

none

Package Sidebar

Install

npm i @gavinb841/gb-alerts

Weekly Downloads

1

Version

0.0.4

License

none

Unpacked Size

80.1 kB

Total Files

27

Last publish

Collaborators

  • gavinb841