Improve this doc View source

Notification
service in module patternfly.notification

Description

Notification service used to notify user about important events in the application.

Configuring the service

You can configure the service with: setDelay, setVerbose and setPersist.

Notifications.setDelay

Set the delay after which the notification is dismissed. The argument of this method expects miliseconds. Default delay is 5000 ms.

Notifications.setVerbose

Set the verbose mode to on (default) or off. During the verbose mode, each notification is printed in the console, too. This is done using the default angular.js $log service.

Notifications.setPersist

Sets persist option for particular modes. Notification with persistent mode won't be dismissed after delay, but has to be closed manually with the close button. By default, the "error" and "httpError" modes are set to persistent. The input is an object in format {mode: persistValue}.

Configuration Example

angular.module('myApp', []).config(function (NotificationsProvider) {
  NotificationsProvider.setDelay(10000).setVerbose(false).setPersist({'error': true, 'httpError': true, 'warn': true});
});

Dependencies

Example

Source





Demo