(function () {
    global.dashModule
        .controller('contactPageCtrl', ['$scope', '$http', 'utilsService', contactPageCtrl])
        .directive('contactPage', [contactPageDirective]);

    function contactPageDirective() {
        return {
            restrict: 'E',
            templateUrl: 'contact/html/contactTemplate'
        };
    }

    function contactPageCtrl($scope, $http, utilsService) {
        $scope.contactInfo = [];
        $scope.getContactInfo = getContactInfo;

        function getContactInfo() {
            $http({
                method: 'GET',
                url: 'contact/api/getContactInfo'
            }).then(setContactInfo, utilsService.onHttpError);
        }

        function setContactInfo(response) {
            if(response.data){
                $scope.contactInfo = response.data;
            }
        }
    }
})();
