javascript - AngularJS ng-show one condition with multiple elements -


i have 3 divs ng-click "showme" boolean. paragraphs have ng-show evaulates "showme".

my question is, how can use 1 condition show paragraph on div click? in other words, if click first div, should see "1", "2" , "3" parapgraphs should stay hidden. ng-repeat not option exercise.

here's jsbin:

http://jsbin.com/kiwicipabago/1/edit

thank you.

you can :

<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> 


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -