//NotificationPageListController

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

        $scope.GetItemIcon = function(type)
        {
            if (type.toLowerCase() === "error")
            {
                return "ic-x-fill";
            }
            if (type.toLowerCase() === "warning")
            {
                return "ic-alert-triangle";
            }
            if (type.toLowerCase() === "success")
            {
                return "ic-check-fill";
            }

            return "ic-info-fill"
        }

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

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