# alert-notification

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

Latest version **1.3.0** (published 2019-06-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install alert-notification
pnpm add alert-notification
yarn add alert-notification
bun add alert-notification
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2019-06-28 |
| First published | 2019-06-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 105 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Harsh Mathur |
| Maintainers | harsh04_ |
| Keywords | angular, alert, notification, service, Material |

## Links

- npm: https://www.npmjs.com/package/alert-notification
- Homepage: https://harsh04.github.io/alert-notification/
- npm.io page: https://npm.io/package/alert-notification

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^1.9.0

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2019-06-28
- 1.2.9 — 2019-06-28
- 1.2.8 — 2019-06-28
- 1.2.7 — 2019-06-28
- 1.2.6 — 2019-06-28
- 1.2.5 — 2019-06-24
- 1.2.4 — 2019-06-24
- 1.2.3 — 2019-06-24
- 1.2.2 — 2019-06-24
- 1.2.1 — 2019-06-24
- 1.2.0 — 2019-06-24
- 1.0.1 — 2019-06-21

## README

# 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](https://harsh04.github.io/alert-notification).

## 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 ''
3. Title
4. 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.

---
_Source: https://npm.io/package/alert-notification · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
