asduser / ui-notifications

:postbox: Sevice to handle different notifications due to suitable types: popup, window, inform, promt etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UI-Notifications on Angular.js

Demo

Open demo page

Description

Angular.js service, which may significantly facilitate a process of managing UI notifications. Actually you may use one of the following message types:

  • success
  • error
  • info
  • warning

How does it work

  // Display 'error' popup.
  vm.openErrorPopup = function(){
      uiNotifications.popup("Enter your message here...");
  };

  // Display 'success' popup.
  vm.openSuccessPopup = function(){
      uiNotifications.popup("All is ok!", "success");
  };

  // Wait confirmation from user and if true invoke an appropriate function.
  vm.confirm = function(){
      uiNotifications.confirm(Greeting, "Do you want to run a 'Greeting' method?", {title: "Confirm your action!"} );
  };

  // Display a simple inform window. It will be closed automatically.
  vm.inform = function(){
      uiNotifications.inform();
  };

  function Greeting(){
      alert("Some actions after confirmation...");
  }

Dependencies

This service uses a jQuery notification plugin "lobibox". Be sure, that it was injected into your main project.

About

:postbox: Sevice to handle different notifications due to suitable types: popup, window, inform, promt etc.


Languages

Language:JavaScript 79.3%Language:CSS 20.0%Language:HTML 0.6%