I had a use case in which I should still hide the HTML element using CSS, as follows:
HTML:
<div class="item">
</div>
CSS
.item {
display: none;
}
But I need to switch the item visibility with ng-show after loading the page as follows:
<div class="item" ng-show="show_element">
</div>
But even if the parameter is $scope.show_elementset to true, the element will not become visible, i.e. the css property overrides AngularJS 'ng-show. Is there a way to give ng-show a higher priority?
Alternatively, you might think that I can save $scope.show_elementas false to hide it. But in this case, I get a very short idea of the element when the page loads, which is not very good from a UX point of view.