mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 18:43:26 +01:00
18 lines
584 B
JavaScript
18 lines
584 B
JavaScript
angular.module('services.notifications', []);
|
|
angular.module('services.notifications').factory('Notifications', function(){
|
|
var notifications = [];
|
|
var Notifications = {};
|
|
Notifications.push = function(type, msg){
|
|
notifications.push({type: type, msg: msg});
|
|
};
|
|
Notifications.getAll = function(){
|
|
return notifications;
|
|
};
|
|
Notifications.remove = function(notification){
|
|
var index = notifications.indexOf(notification);
|
|
notifications.splice(index, 1);//remove element from the array, ugly
|
|
};
|
|
|
|
return Notifications;
|
|
});
|