Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-flash

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-flash

Angular.js Flash Messages

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 04 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc