Author: | cornflourblue |
---|---|
Official Page: | Go to website |
Publish Date: | December 4, 2017 |
License: | MIT |
Description:
A simple reusable alert/toaster notification service and component in an Angular 2/5 application using TypeScript.
Installation:
# NPM $ npm install angular2-alert-notifications --save
Usage:
Import the library to your Angular module (app.module.ts).
import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { routing } from './app.routing'; import { AlertComponent } from './_directives/index'; import { AlertService } from './_services/index'; import { HomeComponent } from './home/index'; @NgModule({ imports: [ BrowserModule, routing ], declarations: [ AppComponent, AlertComponent, HomeComponent ], providers: [ AlertService ], bootstrap: [AppComponent] }) export class AppModule { }
Use as component (app.component.html)
<alert></alert> <router-outlet></router-outlet>