[SOLVED] Ng-hide/ng-show not working as should


#1
.controller('NoticiasCtrl', function ($scope, $timeout) {
  var pic = new Image();
  pic.src="img/posts_empty.png";

$scope.noPosts = false;
$scope.posts = [];

$timeout(function() {
    if(cacheLatestPosts.length == 0) {
        $scope.noPosts = true;
    }
} , 300, false);
})

My will is to show or hide the list and the empty message based on the availability of items.
But after the timeout the value changes but the visibility doesn’t.


#2

the issue was the third parameter of the timeout…