acha-framework
Version:
is a modular framework on both client (angular.js) and server (node.js) side, it provides security, orm, ioc, obfuscation and ...
37 lines • 1.29 kB
JavaScript
(function ($, angular, underscore, window, document, undefined) {
'use strict';
angular.module('frontend.services').factory('notificationService', [
'translateService',
function (translateService) {
return {
error: function (message, title, options, isTranslate) {
if (isTranslate === undefined)
isTranslate = true;
if (isTranslate) {
message = translateService(message);
title = translateService(title);
}
toastr.error(message, title, options);
},
success: function (message, title, options, isTranslate) {
if (isTranslate === undefined)
isTranslate = true;
if (isTranslate) {
message = translateService(message);
title = translateService(title);
}
toastr.success(message, title, options);
},
info: function (message, title, options, isTranslate) {
if (isTranslate === undefined)
isTranslate = true;
if (isTranslate) {
message = translateService(message);
title = translateService(title);
}
toastr.info(message, title, options);
}
};
}
]);
}(jQuery, angular, _, window, document));