1.3.0 • Published 5 years ago

alert-notification v1.3.0

Weekly downloads
245
License
MIT
Repository
-
Last release
5 years ago

AlertNotification

A lightweight easy to use module to display alert notifications inside you Angular web applications.

Github Code Link : https://github.com/harsh04/alert-notification

Demo

Sample implementation with controls : GitHub Pages.

Install

You can import your library in any Angular application by running:

$ npm install alert-notification

and then from your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
 
import { AppComponent } from './app.component';
 
// Import your library
import { AlertModule } from 'alert-notification';
 
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
 
    // Specify your library as an import
    AlertModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

How to use

Add following tag on the <alert-notification></alert-notification> root html such as app.component.html.

Import following service in your component:

import { AlertService } from 'alert-notification';

constructor(private alert: AlertService) { }

Create New Alert

this.alert.push('id-01', 'Info', 'New Request', 'You have received a new mail');

Parameters : 1. ID 2. Type

  • Info
  • Success
  • Warning
  • Empty string ''
  1. Title
  2. Message

Configure Alerts

Position

this.alert.setPosition('top-left');

Default position : 'bottom-right' Avalilabe options: 1. 'top-left' 2. 'bottom-left' 3. 'top-right' 4. 'bottom-right'

Dismiss Interval

this.alert.setInterval(5000);

Default Interval : 5000 (in ms)

Auto Dismiss alert

this.alert.setAutoDismiss(true);

Default value : true

  • if you want disable auto dismiss, set it to false.
1.3.0

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.0.1

5 years ago