This repository has been archived on 2021-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
M2OLA/frontend/app/scripts/controllers/userSpace.js

72 lines
2.4 KiB
JavaScript
Executable File

(function () {
'use strict';
angular.module('clientApp')
.controller('UserSpaceCtrl', ['$scope', '$state',
function ($scope, $state) {
$scope.toggleAccordion = toggleAccordion;
$scope.isOpenAccordion = isOpenAccordion;
$scope.logout = logout;
$scope.exportBooklet = exportBooklet;
init();
// ---------------------------------------------------------------
function init() {
$scope.periods = [
{
number : 2,
company: {
icon : 'add',
comment: ''
},
university: {
icon : 'add',
comment: ''
}
},{
number : 1,
company: {
icon : 'add',
comment: ''
},
university: {
icon : 'add',
comment: ''
}
}
];
}
function toggleAccordion(value, isCompany, index) {
var newValue = (value === 'add') ? 'remove': 'add';
if(isCompany === 'true') {
$scope.periods[index].company.icon = newValue;
} else {
$scope.periods[index].university.icon = newValue;
}
}
function isOpenAccordion(value) {
return (value === 'remove');
}
function logout() {
$state.go('login');
}
function exportBooklet() {
console.log('export booklet .. TODO ');
}
// ---------------------------------------------------------------
// Public method -------------------------------------------------
// ---------------------------------------------------------------
}]);
})();