Reputation: 1457
I have html like this
<div ng-controller="ClientCtrl">
<div ng-show="shows">hello</div>
<div ng-show="show">world</div>
<button ng-click="show=!show">click</button>
</div>
When I click on click button I am able to show second div (World ) . But I want to show both div when I click on click button. How to do it.?
Upvotes: 0
Views: 794
Reputation: 26940
Try this:
<div ng-show="show">hello</div>
<div ng-show="show">world</div>
Upvotes: 2
Reputation: 40318
If the divs need to show on different variables, then you can try this:
<button ng-click="show=!show;shows=!shows">click</button>
Or a function in the controller. But do they really need to display on different variables?
Upvotes: 2