Files
old-wiaas-legacy/api-wiaas/client/js/components/contact/contact-page.directive.js
2018-06-11 11:09:35 +02:00

31 lines
862 B
JavaScript

(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;
}
}
}
})();