(function () {
    'use strict';
    angular
        .module("myApp.presents")
        .factory("dataGiftService", dataGiftService);

    function dataGiftService($mdToast, $mdDialog) {
        var dataGiftService = {
            notification: notification,
            pleaseWaitDialog: pleaseWaitDialog
        };

        function notification(status, msg, time) 


        function pleaseWaitDialog(msg, parentEl) {
            if (angular.isUndefined(parentEl)) {
                parentEl = angular.element(document.body);
            }

            $mdDialog.show({
                parent: parentEl,
                template: '<md-dialog class="wait-dialog" aria-label="Please wait">' +
                '  <md-dialog-content layout="column" layour-align="center center">' +
                '<h1 class="text-center">Proszę czekać</h1>' +
                '<md-content class="text-center">' + msg + '</md-content>'+
                '  </md-dialog-content>' +
                '</md-dialog>'
            });
        }

        return dataGiftService;
    }
})();
{

            if (angular.isUndefined(time))
                time = 3000;

            $mdToast.show(
                $mdToast.simple()
                    .textContent(msg)
                    .position("top right")
                    .hideDelay(time)
                    .theme(status)
            );
        }