Is there a way to do a ng-hide on a html div?

后端 未结 4 1949
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-24 03:53

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?



        
4条回答
  •  日久生厌
    2021-01-24 04:32

    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

    . You can always change $scope.hideCrossfade = false; in your controller to make the div visible again.

提交回复
热议问题