vox-alert
v0.0.2
Published
Downloads
5
Readme
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