Shiva Teja ba83cd7092 [GSOC] Angular based UI
Signed-off-by: Sebastien Goasguen <runseb@gmail.com>
2013-07-29 13:32:45 -04:00

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;
});