# angular4-notify

> ## Installation

Latest version **1.2.0** (published 2017-08-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install angular4-notify
pnpm add angular4-notify
yarn add angular4-notify
bun add angular4-notify
```

## 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.2.0 |
| Published | 2017-08-29 |
| First published | 2017-08-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | alexander.poltoratskiy |
| Maintainers | myownsumm |
| Keywords | angular |

## Links

- npm: https://www.npmjs.com/package/angular4-notify
- Repository: https://github.com/myownsumm/angular4-notify
- Homepage: https://github.com/myownsumm/angular4-notify#readme
- Issues: https://github.com/myownsumm/angular4-notify/issues
- npm.io page: https://npm.io/package/angular4-notify

## Recent versions

- 1.2.0 (latest) — 2017-08-29
- 1.1.0 — 2017-08-27
- 1.0.1 — 2017-08-21
- 0.1.0 — 2017-08-20
- 1.0.0 — 2017-08-20

## README

# angular4-notify

## Installation

To install this library, run:

```bash
$ npm install angular4-notify --save
```

## How to use

Import notifications module and service:

```typescript
import {NotificationsModule, NotificationsService} from 'angular4-notify';

@NgModule({
  declarations: [
    YouComponent
  ],
  imports: [
    SomeModule,

    //add to imports
    NotificationsModule
  ],
  providers: [
      //add to providers
      NotificationsService
  ],
  bootstrap: [YouComponent]
})
export class YourModule {}
```

Once library is imported, you can use its service in your Angular application:

```xml
<!-- You can now use your library component in app.component.html -->

<header></header>

<angular4-notify-notifications-container></angular4-notify-notifications-container>

<router-outlet></router-outlet>
```

## Adding notifications

To add notifications to be rendered firstly inject NotificationsService into your component:

```typescript
import {NotificationsService} from 'angular4-notify';

constructor(protected notificationsService: NotificationsService) {}
````
and then use following methods:

```typescript
this.notificationsService.addError('Error message here');
this.notificationsService.addWarning('Some warning message');
this.notificationsService.addInfo('Information message');
````

## Changelist

**1.2.0** Clear notifications after navigation start.

**1.1.0** Prevent from similar messages doubling.

**1.0.1** First stable version

##TODO
* allow customize styles
* provide more flexible notifications` container position on page
* implement "dialog" notification feature

## License

MIT © [alexander.poltoratskiy](mailto:myownsumm@gmail.com)

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