vox-alert
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

1. Install Vox Alert globally:

$ npm install --global vox-alert

2. Install Vox Alert in your project devDependencies:

$ npm install --save-dev vox-alert

3. Setup Module

Import VoxAlertModule into your app.module.

import { VoxAlertModule } from 'vox-alert';

@NgModule({
  ...
  imports: [
    VoxAlertModule
  ],
})

4 . Basic Usage

Import AlertService into your app.component

import { Component } from '@angular/core';

import { AlertService } from 'vox-alert/alert/alert-service';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
    public title = 'app';
    private _alertService: AlertService;
    
    constructor(
      alertService: AlertService
    ) {
      this._alertService = alertService;
    }

    open() {
      this._alertService.openalert('AlertServiceService', 'alert title', 'success');
    }
}

5. Setup View

Place the app-alert selector at the bottom of your app.component.html

<button type="button" class="btn btn-info" (click)="open()">Create template alert</button>

<app-alert></app-alert>

Alert Types

The following message types are avialable. The typess below represent the Bootstrap alert classes.

  • success
  • info
  • warning
  • danger

Package Sidebar

Install

npm i vox-alert

Weekly Downloads

1

Version

0.0.2

License

ISC

Unpacked Size

40.4 kB

Total Files

16

Last publish

Collaborators

  • zezynho