angular-flash-alert

angular-flash

Demo

angular-flash, jsfiddle


Add the Following code to the <head> of your document.

<link type="text/css" rel="stylesheet" href="css/angular-flash.min.css" />

// If you are using bootstrap v3 no need to include angular-flash.css

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>

<script src="angular-flash.min.js"></script>

// Do not include both angular-flash.js and angular-flash.min.js


Add flash dependency to your module

var myApp = angular.module("app", ["flash"])


Include <div flash-message="5000" ></div> directive in your html template.

// 5000 milli-secs is the display duration. // Flash alert will be automatically dismissed after 5000 milli-secs.


Inject the Flash factory in your controller

myApp.controller('demoCtrl', ['Flash', function(Flash) { ... }])

Flash.add('success', message, 'custom-class')


Flash alert types

  • success
  • info
  • warning
  • danger

Methods

Flash.pause();

// Pause flash auto dismiss.

Flash.dismiss()

// Dismiss the flash


More info

Demo, github

comments powered by Disqus
This page was last updated almost 3 years ago.