0.2.2 • Published 3 years ago

ngx-notification-msg v0.2.2

Weekly downloads
55
License
MIT
Repository
github
Last release
3 years ago

NgxNotificationMsg

NPM Version NPM Downloads

Angular Library to display notification message.

Demo

ƒ

npm.io

Installation

1. Download from npm

npm install ngx-notification-msg --save

2. Import the NgxNotificationMsgModule module

import {NgxNotificationMsgModule} from 'ngx-notification-msg'

3. Add NgxNotificationMsgModule to your module imports

 @NgModule({ ... imports: [ ... NgxNotificationMsgModule ] })

4. Import the NgxNotificationMsgService service in any angular component

import {NgxNotificationMsgService} from 'ngx-notification-msg'

5. Inject the NgxNotificationMsgService service in the angular component's constructor

 constructor(private readonly ngxNotificationMsgService: NgxNotificationMsgService) {
 
 }

6. Now you can use ngxNotificationMsgService service

 this.ngxNotificationMsgService.open({
    status: NgxNotificationStatusMsg.SUCCESS,
    header: 'Hey',
    messages: ['How are you today ?!']
 });

API

Use the NgxNotificationMsgService service in any angular component you like.

Methods

open(inputsConfig: INgxNotificationMsgConfig, element?: Element): void

Enums & Interfaces

export enum NgxNotificationStatusMsg {
    SUCCESS = 'SUCCESS',
    FAILURE = 'FAILURE',
    INFO = 'INFO',
    NONE = 'NONE'
}

export enum NgxNotificationDirection {
    TOP = 'TOP',
    TOP_RIGHT = 'TOP_RIGHT',
    TOP_LEFT = 'TOP_LEFT',
    BOTTOM = 'BOTTOM',
    BOTTOM_RIGHT = 'BOTTOM_RIGHT',
    BOTTOM_LEFT = 'BOTTOM_LEFT'
}

interface INgxNotificationMsgConfig {
    status?: NgxNotificationStatusMsg;
    direction?: NgxNotificationDirection;
    header?: string;
    messages: string[];
    color?: string;
    delay?: number;
    displayIcon?: boolean;
    displayProgressBar?: boolean;
    closeable?: boolean;
}

Notes

  • Multiple directions can't live at the same time.
0.2.1

3 years ago

0.2.2

3 years ago

0.2.0

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.2

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago