ansible/ngToast

Name: ngToast

Owner: Ansible

Description: Angular provider for toast notifications

Forked from: leigh-johnson/ngToast

Created: 2016-12-05 15:46:51.0

Updated: 2017-12-19 13:03:21.0

Pushed: 2017-11-27 15:52:29.0

Homepage: http://tameraydin.github.io/ngToast/

Size: 1235

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ngToast Code Climate Build Status

ngToast is a simple Angular provider for toast notifications.

Demo

Usage
  1. Install via Bower or NPM:

    r install ngtoast --production
    
    install ng-toast --production
    

    or manually download.

  2. Include ngToast source files and dependencies (ngSanitize, Bootstrap CSS):

    k rel="stylesheet" href="bower/bootstrap/dist/css/bootstrap.min.css">
    k rel="stylesheet" href="bower/ngtoast/dist/ngToast.min.css">
    
    ipt src="bower/angular-sanitize/angular-sanitize.min.js"></script>
    ipt src="bower/ngtoast/dist/ngToast.min.js"></script>
    

    Note: only the Alerts component is used as style base, so you don't have to include complete CSS

  3. Include ngToast as a dependency in your application module:

    app = angular.module('myApp', ['ngToast']);
    
  4. Place toast element into your HTML:

    y>
    st></toast>
    
    dy>
    
  5. Inject ngToast provider in your controller:

    controller('myCtrl', function(ngToast) {
    ast.create('a toast message...');
    
    or more info: http://tameraydin.github.io/ngToast/#api
    
Animations

ngToast comes with optional animations. In order to enable animations in ngToast, you need to include ngAnimate module into your app:

ipt src="bower/angular-animate/angular-animate.min.js"></script>

Built-in

  1. Include the ngToast animation stylesheet:

    k rel="stylesheet" href="bower/ngtoast/dist/ngToast-animations.min.css">
    
  2. Set the animation option.

    config(['ngToastProvider', function(ngToastProvider) {
    astProvider.configure({
    imation: 'slide' // or 'fade'
    
    
    

    Built-in ngToast animations include slide & fade.

Custom

See the plunker using animate.css.

  1. Using the additionalClasses option and ngAnimate you can easily add your own animations or wire up 3rd party css animations.

    config(['ngToastProvider', function(ngToastProvider) {
    astProvider.configure({
    ditionalClasses: 'my-animation'
    
    
    
  2. Then in your CSS (example using animate.css):

    dd any vendor prefixes you need */
    animation.ng-enter {
    ation: flipInY 1s;
    
    
    animation.ng-leave {
    ation: flipOutY 1s;
    
    
Settings & API

Please find at the project website.

Development
License

MIT http://tameraydin.mit-license.org/

Maintainers
TODO

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.