• Stars
    star
    99
  • Rank 343,315 (Top 7 %)
  • Language
    JavaScript
  • Created over 11 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Flash messages for Angular.js

angular-flash

Bitdeli Badge Build Status

Flash messages for Angular.js. Demo

Supports view changes, which means you can set a flash message, navigate to another view and your message will be displayed.

Install

bower install angular-flash-messages

Usage

After adding angular-flash.js to your project, add flash as a dependency to your module. Here is a simple example:

angular.module('myModule', ['flash'])
.controller('EditProductController', function($scope, flash) {
  $scope.save = function() {
    // … save the product
    flash('Saved!');
  };
});

Then, in your HTML, simply add the <flash:messages> element where you want your messages to be displayed. It can be in your main template or individual partials.

  <body ng-app="myModule">
    <flash:messages></flash:messages>

    <main ng:controller="HomeController">
      <h1>Home</h1>
    </main>
  </body>

IE Support

If you need IE8 support (or prefer), you can use the attribute directive: <ol flash:messages></ol>.

Examples

  • flash('My message')
<ol id="flash-messages">
  <li class="success">My message</li>
</ol>
  • flash([ 'Hi!', 'My message' ])
<ol id="flash-messages">
  <li class="success">Hi</li>
  <li class="success">My message</li>
</ol>
  • flash('error', 'Something went wrong…')
<ol id="flash-messages">
  <li class="error">Something went wrong…</li>
</ol>
  • flash([ 'Hi!', { level: 'warning', text: 'This is a warning!' } ])
<ol id="flash-messages">
  <li class="success">Hi</li>
  <li class="warning">This is a warning!</li>
</ol>

License

This is licensed under the feel-free-to-do-whatever-you-want-to-do license.

More Repositories

1

ooze

🧬 Go Mutation Testing
Go
253
star
2

draggable.js

Make your DOM elements draggable easily
JavaScript
121
star
3

stripe-angular

Angular directives to deal with Stripe.
JavaScript
112
star
4

lambda

Fun with λ calculus!
JavaScript
90
star
5

keyvent.js

Keyboard events simulator
JavaScript
46
star
6

passport-stub

Passport.js stub for testing.
CoffeeScript
44
star
7

elysia-tailwind

Elysia Tailwind Plugin
TypeScript
36
star
8

elysia-htmx

Elysia HTMX Context
TypeScript
35
star
9

Writeboard

Whiteboard for distributed teams
CoffeeScript
31
star
10

docker-diagrams

An image for https://github.com/mingrammer/diagrams
Python
24
star
11

h-factors

Hypermedia Factors
Less
23
star
12

griffith.cr

Beautiful UI for showing tasks running on the command line.
Crystal
21
star
13

mongoose-friendly

Friendly URLs for your Mongoose models
JavaScript
15
star
14

walter.cr

Keep your crystal clean!
Crystal
14
star
15

go-extlib

Go Extended Lib
Go
11
star
16

spinner-frames.cr

A collection of spinner frames
Crystal
11
star
17

spring-river

Rapids/Rivers/Ponds – https://vimeo.com/79866979
JavaScript
10
star
18

ghooks.gradle

Simple git hooks
Kotlin
9
star
19

docker-semantic-release

An image for https://github.com/semantic-release/semantic-release
Makefile
7
star
20

dotfiles

System Setup
Nix
7
star
21

gmailto

Send quick Gmails from your command line.
JavaScript
7
star
22

ansi-escapes.cr

ANSI escape codes for manipulating the terminal.
Crystal
6
star
23

elysia-requestid

Elysia Request ID Plugin
TypeScript
6
star
24

cloudbees-node

Quick and dirty bash script to add node.js and npm to your cloudbees Jenkins project
Shell
6
star
25

loading.js

Simple messages to your website
CoffeeScript
4
star
26

sourcing

🐾 Simple Event Sourcing
JavaScript
4
star
27

elysia-error-handler

Elysia Error Handler
TypeScript
4
star
28

mongod-run

Runs mongod. Useful when testing APIs.
JavaScript
3
star
29

ghooks.cr

simple git hooks for crystal
Crystal
3
star
30

jekyll.workflow

master ⇝ gh-pages
CSS
3
star
31

docker-commitlint

An image for https://github.com/marionebl/commitlint
Makefile
2
star
32

go-rambo

Prevalent System implementation based on PrevaylerJr
Go
2
star
33

freenodejs

Search on #Node.js at freenode.net - through nodejs.debuggable.com
JavaScript
2
star
34

docker-svgbob

Docker image for https://github.com/ivanceras/svgbob
Makefile
2
star
35

elysia-authkit

Elysia AuthKit Plugin
TypeScript
1
star
36

gtramontina.github.io

Personal Website
HTML
1
star
37

npmw

NPM .bin wrapper
JavaScript
1
star
38

cssee

See your DOM elements with CSSee!
JavaScript
1
star
39

docker-live-server

An image for https://github.com/tapio/live-server
Makefile
1
star