# ng-snackbar.es6

> Snackbar angular.js module in ES6.

Latest version **0.5.0** (published 2017-09-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install ng-snackbar.es6
pnpm add ng-snackbar.es6
yarn add ng-snackbar.es6
bun add ng-snackbar.es6
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2017-09-13 |
| First published | 2017-05-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | ohpyupi |
| Maintainers | ohpyupi |

## Links

- npm: https://www.npmjs.com/package/ng-snackbar.es6
- npm.io page: https://npm.io/package/ng-snackbar.es6

## Dependencies (1)

- [dokebi](https://npm.io/package/dokebi.md) ^1.3.8

## Recent versions

- 0.5.0 (latest) — 2017-09-13
- 0.4.0 — 2017-08-08
- 0.3.3 — 2017-08-01
- 0.2.3 — 2017-08-01
- 0.2.2 — 2017-08-01
- 0.2.1 — 2017-08-01
- 0.2.0 — 2017-08-01
- 0.1.1 — 2017-05-11
- 0.1.0 — 2017-05-11

## README

# ng-snackbar.es6
This snackbar angular.js module is designed to provide a varierty of services, such as (1) error handling, (2) notification,
and (3) redirection utilizing ui-router (a peer-dependency).

## Installation
Download the module through [npm](https://www.npmjs.com/).
```
npm install angular-ui-router
npm install ng-snackbar.es6
```
Import the module to the angular app.
```
/*
** main angular module (app.module.js)
*/
import angular from 'angular';
import uirouter from '@uirouter/angularjs';

angular.module('app', [uirouter])
...
```

## Usage
Once the module is registered to the main module, you can bring the module service anywhere you want, for example components,
controllers, or services.

```
import Snackbar from 'ng-snackbar.es6';

export class HomeController {
	constructor($state) {
		this.snackbar = new Snackbar($state, {
			duration: 1,
			closeLabel: "CLOSE",
			xi: -13,
			xf: 20,
			directionFrom: "top",
		});
	}
	fetchUserData() {
		...
		this.snackbar.flash("Successfully loaded a user data!");
	}
}
```
## Methods
#### * snackbar.flash(message, state, params)
1) message (required): It will be displayed in the snackbar
2) state (optional): If specified, it will redirect to the state.
3) params (optional): If specified, it will pass the state parameters to the redirected destination.

## Author
[ohpyupi](https://ohpyupi.wordpress.com/)

## License
Released under the terms of MIT License.

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