Coder Social home page Coder Social logo

defensestorm / angular-foundation-toaster Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jirikavi/angularjs-toaster

0.0 9.0 1.0 260 KB

AngularJS Toaster is a customized version of "toastr" non-blocking notification javascript library.

License: MIT License

JavaScript 100.00%

angular-foundation-toaster's Introduction

angular-foundation-toaster

Angular Foundation Toaster is a AngularJS port of the toastr non-blocking notification jQuery library using Foundation styles and Font-Awesome icons. It requires AngularJS v1.2.6 or higher, Zurb/Foundation and Font-Awesome.

Current Version 0.0.1

Prerequisites

  1. An angular app

  2. Zurb/Foundation

  3. A build that recognizes bower components

Getting started

  1. Install the module:
bower install praesidio/angular-foundation-toaster
  1. Add toaster container directive: <toaster-container></toaster-container>

  2. Prepare the call of toaster method:

	// Display an info toast with no title
	angular.module('main', ['toaster'])
	.controller('myController', function($scope, toaster) {
	    $scope.info = function(){
	        toaster.pop("title", "text");
	    };
	});

	// Display an alert toast with no title
	angular.module('main', ['toaster'])
	.controller('myController', function($scope, toaster) {
	    $scope.alert = function(){
	        toaster.pop("title", "text", {type: 'alert'});
	    };
	});
  1. Call controller method on button click:
<div ng-controller="myController">
    <button ng-click="info()">Show Info</button>
    <button ng-click="alert()">Show Alert</button>
</div>

Other Options

// Change display position
<toaster-container toaster-options="{'container-class': 'left'}"></toaster-container>

Animations

This library uses jqLite and CSS3 animations. So far only a 'leave' anination is supported, and can be specified by simply specifying your own @keyframes style animation class in the toaster-options as 'leave-class'.

Author

Brandon Smith

Credits

Forked from AngularJS-Toaster by Jiri Kavulak which was inspired by http://codeseven.github.io/toastr/demo.html.

Copyright

Copyright © 2014 Brandon Smith.

License

angular-foundation-toaster is under MIT license - http://www.opensource.org/licenses/mit-license.php

angular-foundation-toaster's People

Contributors

chrismansfield avatar danieljsinclair avatar hemdada avatar igmcdowell avatar jakcharlton avatar jirikavi avatar jmontagu avatar martiansnoop avatar mibamur avatar piotrosz avatar reardencode avatar sgurenkov avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

lauraluo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.