Feature: add growl for notification

This commit is contained in:
2015-10-01 12:03:47 +00:00
parent d7847bc6b5
commit 2d3d18ba9b
7 changed files with 32 additions and 17 deletions

View File

@@ -5,9 +5,9 @@
.module('cloudbudget')
.factory('FlashService', FlashService);
FlashService.$inject = ['$rootScope'];
FlashService.$inject = ['$rootScope', 'growl'];
function FlashService($rootScope) {
function FlashService($rootScope, growl) {
var service = {};
service.success = success;
@@ -35,19 +35,11 @@
}
function success(message, keepAfterLocationChange) {
$rootScope.flash = {
message: message,
type: 'success',
keepAfterLocationChange: keepAfterLocationChange
};
growl.success(message,{title: 'Success!'});
}
function error(message, keepAfterLocationChange) {
$rootScope.flash = {
message: message,
type: 'error',
keepAfterLocationChange: keepAfterLocationChange
};
growl.error(message, {title: 'Error!'});
}
}
})();