/ember-flash-queue

Client-side flash queue for Ember applications

Primary LanguageJavaScriptMIT LicenseMIT

ember-flash-queue

Example flash messages

A client side flash queue similar to the Rails flash queue. For use with Ember. Completely ready to drop into an application, styling included. Or you can roll your own styling to better fit your application.

You can view a complete demo here on jsbin.

Assumes App namespace by default. With options for scheduling 'destruction' of flashes. Allowing flashes to be dismissable by the user. And four different color schemes for alerts, info, notices, and warnings.

The necessary Handlebars can be placed in your application template.

<div class="flash-queue">
  {{#each App.flashQueueController}}
    {{view App.FlashMessageView}}
  {{/each}}
</div>

The main interface.

App.flashQueueController.flash('notice', 'Hello World!');

Or even easier alias flash to the top level namespace.

// for ES5 environments
App.flash = App.flashQueueController.flash.bind(App.flashQueueController);

// for ES3 environments
App.flash = function(type, message) {
  App.flashQueueController.flash(type, message);
}

And now you can flash to your ❤️'s content

App.flash('notice', '<3 EmberJS');

Author

twitter/aaronackerman
Aaron Ackerman