(function () {
    'use strict';

    angular
        .module('app')
        .controller('HomeController', HomeController);

    HomeController.$inject = ['UserService', '$rootScope'];
    function HomeController(UserService, $rootScope) {
        var vm = this;

        vm.user = null;
       
        initController();

        function initController() { 
            loadCurrentUser();
            
        }

        function loadCurrentUser() { 
            UserService.GetByEmail($rootScope.globals.currentUser.email)
                .then(function (response) { 
					
					if(response.success){
						vm.user = response.data;
					}
                    
                });
        }

       
    }

})();
