1.0.4 • Published 6 years ago

mw-alert v1.0.4

Weekly downloads
5
License
MIT
Repository
-
Last release
6 years ago

License codebeat badge dependencies Status npm version

mw-alert

AngularJS module that provide contextual feedback messages for typical user actions.

Requirements (tested in)

  • Angular (v1.7.2)

Install

You can install this package either with npm or with bower.

npm

npm install mw-alert --save

bower

bower install mw-alert

Usage

Once the script is included in your html file, simply include the module in your app:

angular.module('myApp', ['mw-alert']);

And use the function 'open' from the Service 'mwAlertService' thusly:

mwAlertService.open({"type": "success", "text": "It is working."})

The alert can be closed from the user with a click on the close button or can be closed inside the code

mwAlertService.close()

You can pass the parameter 'timeout' and 'close_auto' to the message object to change the behaviour of this single message

mwAlertService.open({"type": "success", "text": "It is working.", "close_auto": false})

Config

NameTypeDefaultDescription
parent_selectorstringbodyset the parent selector for the alert
timeoutstring3000set the timeout
close_autobooleantrueshould the alert be closed automaticly
templateUrlstringmw-alert.htmlset the template URL

Demo

View demo on Plunker

Tasklist

  • fix spelling, grammar mistakes
  • create tests