Skip to content

OpenSpan/angular-bootstrap-flash-message

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular Bootstrap flash message

A fork from the angular-flash project, with two aims; to have the flash messages use the Bootstrap styling and have the option to timeout messages.

Installation

bower install angular-bootstrap-flash-message

Usage

angular.controller("Test", [
 '$scope',
 'flash',
 function($scope, flash) {
   flash.success({
     text: "Success message",
     seconds: 10,
     zone: 'form',
     retryCallback: function() { doSomething(); }
     clearPrior: true
   });
 }]);

The module exports the flash service with the following methods:

  • flash.success
  • flash.danger
  • flash.warning
  • flash.info
    • Info does not have a icon or tagline.

Each of these methods take arguments:

  • the flash message
  • (optional) timeout to delete the flash message, in seconds
  • (optional) matching zone to display the message (defaults to unspecified zone)
  • (optional) retry callback
  • (optional) clear existing messages on the matching zone before adding this one

And in order to render the flash messages, you must add the following directive in your template:

<flash:messages></flash:messages>

This defaults to an unspecified zone.

You can also specify a zone to have multiple locations of messages, relating to your controls:

<flash:messages zone="myForm"></flash:messages>

About

Flash messages for Angular.js

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript 68.3%
  • JavaScript 28.1%
  • Makefile 3.6%