I try to create an Angular JS function that is displaying or hiding a Div in case that a certain requirement is met. I do have the problem now that the function is not properly called and both divs are either visible or not visible (In the test case div 1 should be shown and div 2 not).
testApp.controller('MyController', ['$scope','$http',
function ($scope,$http) {
$scope.checkValue = function(value){
if(value >= 1)
return true;
else
return false;
};
}]);
In the html file I try to hide the Divs using the following parameters
<div class="classa" ng-hide="requestsExisting({{profile.arrayA.length}})">
<div class="classb" ng-hide="requestsExisting({{profile.arrayB.length}})">
Is during the run time the {{profile.parameterA.length}}
passed to the function or the actual value that is stored in this variables? (It's 1 for arrayA
and 0 for ArrayB
)
you don't need the "{{" sign. just do
the double curly brace is to put the value of the object in the html