char0n / angular-toastr-flash

Flashing support for https://github.com/Foxandxss/angular-toastr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

angular-toastr-flash

Most of the time you want to flash the message after the route changed. angular-toastr-flash adds support for flashing to angular-toastr.

Installation

$ bower install angular-toastr-flash

Configuration

.config(['flashConfig', function(flashConfig) {
  flashConfig.routeStateChanges = ['$stateChangeSuccess'];
}])

Using angular-toastr-flash

Add angular-toastr-flash to your module dependencies:

angular.module('app', ['angular-toastr-flash']);

Module api for toastr:

// In all calls only first argument is required. Toasts get displyed after successful route change event.
flash.info('Info message');
flash.success('Success message', 'Success title');
flash.warning('Warning message', 'Warning title', {}); // This argument is for angular-toastr-options
flash.error('Error message', 'Error title');

Module api for custom callbacks:

flash.callback(function() {
 // your code goes here.
});

Clearing flash buffer from delayed toasts and custom callbacks: ::

 flash.clear();

Author

char0n (VladimĂ­r Gorej, CodeScale s.r.o.)

References & Credits

About

Flashing support for https://github.com/Foxandxss/angular-toastr

License:Other