FlashMessages are used to give users a kind of feedback or to transport important information.

You can use the implemented FlashMessage feature to create a flashmessage and render it.

mfFlashMessage.create("Hello, I'm a flashMessage").render();

Public Functions

  1. create(message, options) - message String, options obj {}
  2. render()

Options

You can pass the following parameters with the options argument:

var options = { template: 'fade', // fade, confirm delay: 5000, // (template: fade) status: 'info', // info, warn, error closeButton: 'Dismiss', // Default close text (template: fixed) additionalButton: false, message: "" };

Multiple FlashMessages

If you have to create multiple flashmessages

mfFlashMessage.create("I'm the first one", {template: 'confirm'}); mfFlashMessage.create("I'm the second one", {template: 'confirm'}); mfFlashMessage.render();
mfFlashMessage.create("I'm the first one", {template: 'fade'}); mfFlashMessage.create("I'm the second one", {template: 'fade'}); mfFlashMessage.render();

Don't do the following!

You always have to call the render() function at the very end.

mfFlashMessage.create("I'm the first one").render(); mfFlashMessage.create("I'm the second one").render();