Sha256: f00d25241f0d78b7ac35480b8459af9ef4158846d5ed932ff26fbbfac0ee16de
Contents?: true
Size: 1004 Bytes
Versions: 17
Compression:
Stored size: 1004 Bytes
Contents
/** * @ngdoc service * @name Bastion.components.service:Notification * * @description * Service to display a foreman toast notification */ angular.module('Bastion.components').service("Notification", ['$interpolate', 'foreman', function ($interpolate, foreman) { function interpolateIfNeeded(message, context) { var result = message; if (context) { result = $interpolate(message)(context); } return result; } this.setSuccessMessage = function (message, context) { foreman.toastNotifications.notify({message: interpolateIfNeeded(message, context), type: 'success'}); }; this.setWarningMessage = function (message, context) { foreman.toastNotifications.notify({message: interpolateIfNeeded(message, context), type: 'warning'}); }; this.setErrorMessage = function (message, context) { foreman.toastNotifications.notify({message: interpolateIfNeeded(message, context), type: 'danger'}); }; }]);
Version data entries
17 entries across 17 versions & 1 rubygems