One of the functionalities is to display a dropdown menu when a button is clicked, but there are certain items that should not be shown based on specific conditions.
function dropdownMenu(params) {
var ownFunction = params.data.functieMijnLicentieHouder;
if (params.data.systeem === 'VVT' && (ownFunction || (!ownFunction && fwgAuthService.userHasClaim('FWGVVT FWG functieonderzoek')))){
return '<div class="io-dropdown"><img src="img/arrow_blue_down.png" ng-click="vm.showMenu(data)"/>' +
'<ul ng-show="data.showMenu" ng-mouseleave="data.showMenu = false">' +
'<li>View job description</li>' +
'<li>View job motivation</li>' +
'<li ng-show="!!ownFunction"> Update job motivation </li>' +
'<li>it works</li>' +
'</div>';
} else if (params.data.systeem === 'FWG3' && (ownFunction || (!ownFunction && fwgAuthService.userHasClaim('FWGVVT FWG functieonderzoek')))){
return '<div class="io-dropdown"><img src="img/arrow_blue_down.png" ng-click="vm.showMenu(data)"/>' +
'<ul ng-show="data.showMenu" ng-mouseleave="data.showMenu = false">' +
'<li>View job motivation</li>' +
'<li>View FWG 3 Classification</li>'+
'</ul>' +
'</div>';
}
}
The initial value of ownFunction
is true. I have verified this with console.log before the if statement and the ng-show functionality does seem to work. However, it is displaying opposite results i.e. False when it should be True, and True when it should be False. This behavior is puzzling to me.