Alert Work flow

Bindable Properties

  1. alertMdl

Overview

Shows alert based on alert type.

Features/Functionality

  • Shows alert based on alert type.
  • Alert will be shown with a min width of 300px and max width of 600px.
  • The default position of alert will be top center for desktops and bottom center for small screen.

Defaults

  • Alert type will be taken as 'info'.
  • Position for small screen will be taken as 'BOTTOM_CENTER'.
  • For desktop, position will be taken as 'TOP_CENTER'.
  • In options visibleTimeInMS, is taken as 3000.

Breakdown

  • Get alert type and position.
  • Add the alert to an array that needs to be shown.
  • Add setTimeOut to property to each alert for the time it needs to be shown.
  • In timeout , call removeAlert method.
  • In removeAlert method, fade the alert by giving time and then rmove it from array.
  • On hover of the alert, clear timeout and show close icon.
  • On click of close icon, remove alert.