/** * data service * * @module app/common/services/toastService * @exports toastService * @name toastService */ window.angular && (function(angular) { 'use strict'; angular.module('app.common.services').service('toastService', [ 'ngToast', '$sce', function(ngToast, $sce) { this.error = function(message) { var errorMessage = $sce.trustAsHtml( '
Error
' + message + '
'); ngToast.create({className: 'danger', content: errorMessage}); }; this.success = function(message) { var successMessage = $sce.trustAsHtml( '
Success!
' + message + '
'); ngToast.create({className: 'success', content: successMessage}); }; } ]); })(window.angular);