# ngx-alertbox

> This project insert a

Latest version **0.0.0** (published 2018-03-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-alertbox
pnpm add ngx-alertbox
yarn add ngx-alertbox
bun add ngx-alertbox
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2018-03-28 |
| First published | 2018-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 11 |
| Unpacked size | 76 KB |
| Known vulnerabilities | 0 (+22 in 3 direct dependencies) |
| Install scripts | no |
| Maintainers | cokenhe |

## Links

- npm: https://www.npmjs.com/package/ngx-alertbox
- npm.io page: https://npm.io/package/ngx-alertbox

## Dependencies (11)

- [tslib](https://npm.io/package/tslib.md) ^1.7.1
- [core-js](https://npm.io/package/core-js.md) ^2.4.1
- [zone.js](https://npm.io/package/zone.js.md) ^0.8.14
- [@angular/core](https://npm.io/package/@angular/core.md) ^5.0.0
- [@angular/http](https://npm.io/package/@angular/http.md) ^5.0.0
- [@angular/forms](https://npm.io/package/@angular/forms.md) ^5.0.0
- [@angular/common](https://npm.io/package/@angular/common.md) ^5.0.0
- [@angular/compiler](https://npm.io/package/@angular/compiler.md) ^5.0.0
- [@angular/animations](https://npm.io/package/@angular/animations.md) ^5.0.0
- [@angular/platform-browser](https://npm.io/package/@angular/platform-browser.md) ^5.0.0
- [@angular/platform-browser-dynamic](https://npm.io/package/@angular/platform-browser-dynamic.md) ^5.0.0

## Recent versions

- 0.0.0 (latest) — 2018-03-28

## README

# ng5-alertbox

This project insert a

## Usage

1.  Install with npm

```bash
npm install ng5-alertbox
```

2.  Import to project

```Typescript
import { NgxAlertboxModule } from './ngx-alertbox/ngx-alertbox.module'

@NgModule({
  declarations: [],
  imports: [
    NgxAlertboxModule.forRoot({ })
  ],
  providers: [],
  bootstrap: []
})
export class AppModule { }
```

3.  Add `NgxAlertboxService` to Coponent

```TypeScript
import { NgxAlertboxService } from './ngx-alertbox/ngx-alertbox.service'

...
export class AppComponent {
  constructor(
    public boxService: NgxAlertboxService
  ) { }
}
```

## Config and API

Configuration in `NgxAlertBoxModule.forRoot({})`
| Config | Usage |
| ---------------- | -------------------------- |
| `autoRemove` | number of second to remove the alertbox, 0 to disable |
| `title` | set the title of the alertbox |
| `message` | set the message of the alertbox |

Add method to Typescript or HTML to **create** and **remove** the alertbox
| Method | Usage |
| ---------------- | -------------------------- |
| `add()` | add a alertbox to the view |
| `clearLastOne()` | remove the oldest alertbox |
| `clearAll()` | reamove all the alertbox |

### Example

```Typescript
...
// Configuartion in app.module.ts
imports: [
    NgxAlertboxModule.forRoot({
        autoRemove: 0,
        title: "Title",
        message: "Message",
    })
],


// Create and Remove in component.ts
import { NgxAlertboxService } from './ngx-alertbox/ngx-alertbox.service'
...
export class AppComponent {
    constructor(
        public boxService: NgxAlertboxService
    ) { }

    someMethod() {
        // Do something here
        this.boxService.add()

        // Do others here
        this.boxService.clearAll()
    }
}
```

## Roadmap
1. Make it responsive
2. Adding animation when alertbox enter and exit the view
2. Adding more configuration api


## Limitation

This library is only tested on [Angular.io v5.0.0](https://angular.io).

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