I have some filters using ng-show
and I need show a div when all others div it's hidden.
I create a function to count divs, it's work but when all divs is hidden the div only show in next interation, for example.
I have 3 divs, Plan 1, Plan 2 and Plan 3... when I find for Plan 4 all divs hidden, but only I put more one character ex: Plan 44... is that the div appears.
ng-repeat
<div ng-repeat="plan in plans | filter:palavra_chave" >
<div class="plano" ng-if="plan.value <= filter_value && plan.download_mb >= filter_mb && plan.fee <= filter_adesao">
</div>
div i'm trying show
<div ng-if="div() == 0" class="card-panel center ">
Angular function to count divs
$scope.contar_div = function()
{
return conta_planos();
}
this is the function to count divs
function conta_planos()
{
return $('.plano').length
}
conta_planos is a javascript function in view