I have three divs with an ng-click with a "showMe" boolean. Their paragraphs have an ng-show that evaulates "showMe".
My question is, how can I use one condition to show the paragraph on the div I click? In other words, if I click the first div, I should only see "1", the "2" and "3" parapgraphs should stay hidden. ng-repeat is not an option for this exercise.
Here's a JSBin:
http://jsbin.com/kiwicipabago/1/edit
Thank you.
You can do like this :
<div ng-app="app">
<div ng-controller="AppCtrl">
<div class="box" ng-click="showMe = 1">
<p ng-show="showMe ==1">1</p>
</div>
<div class="box" ng-click="showMe = 2">
<p ng-show="showMe==2">2</p>
</div>
<div class="box" ng-click="showMe = 3">
<p ng-show="showMe ==3">3</p>
</div>
</div>