//NotificationPageListController

backupApp.controller('NotificationPageListController', 
    function ($rootScope
        , $scope
        , AppUtils
        , NotificationService)
    {
        $scope.Notifications = []

        $scope.GetItemIcon = function(type)
        {
            if (type.toLowerCase() === "error")
            {
                return "fa-times-circle";
            }
            if (type.toLowerCase() === "warning")
            {
                return "fa-exclamation-circle";
            }
            if (type.toLowerCase() === "success")
            {
                return "fa-check-circle";
            }

            return "fa-info-circle"
        }

        
        $scope.RelativeDate = function(date)
        {
            return AppUtils.RelativeDate(date);
        }
        

        NotificationService.getAllNotifications().then(data => {
            $scope.Notifications = data;
            
            $scope.$digest();
        })
    }
);