I am trying to hide my div that has id=\"crossfade\" where there is an ng-click event.
1) Is this possible? 2) What am I doing wrong?
Yes this is definitely possible. ng-hide
expects a boolean value, either true or false. Is getData('Tops')
returning a boolean in your controller? I would recommend using a $scope variable rather than a function to control the behavior of ng-hide
. So in your getData()
function, you could assign something like: $scope.hideCrossfade = true;
.
Then in your view, just use $scope.hideCrossfade = false;
in your controller to make the div visible again.