I am trying to create an overlay feature for a button using the following code:
<div id="overlay" ng-if="vm.showOverlay">{{control}}</div>
<button ng-mouseover="vm.showOverlay = true" ng-mouseleave="vm.showOverlay = false" class="btn" ng-class="{classWhite: control.values.value1, classRed: control.values.value2, classOrange: control.values.value3}" ng-click="colorChange(control)"></button>
However, the data I receive from:
<td ng-repeat="control in general">
is a complex object that requires a specific function to extract the value to be displayed:
$scope.stateFromControl=function(control){
var values=control.values;
var resultValue=(values.value1)?0:(values.value2)?1:2;
return translateState(resultValue);
}
Unfortunately, inserting this function directly into the {{}} does not work. How can I properly implement it?