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
Post a Comment