Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng-snackbar.es6

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-snackbar.es6

Snackbar angular.js module in ES6.

  • 0.1.0
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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.

npm install angular-ui-router
npm install ng-snackbar.es6

Import the module to the angular app.

/*
** main angular module (app.module.js)
*/
import uirouter from 'angular-ui-router';
import Snackbar from 'ng-snackbar.es6';

angular.module('app', [uirouter])
.service('snackbar', Snackbar);

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.

export class HomeController {
  constructor(snackbar) {
    this.snackbar = snackbar;
  }
  testMethod() {
    this.snackbar.flash("Hello world!");
  }
}

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

License

Released under the terms of MIT License.

FAQs

Package last updated on 11 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc