Being a general angular newbie and also trying to find an answer to my question for hours. I finally gave up and figured it's probably better to ask from more knowledgable people, so here goes.
I have multiple tabs that are supposed to drop down a container. Initially nothing is open. On click a dropdown opens and when clicking again it should close. Also when clicking on another button, the current open container should close as well.
Here is my current code:
<div ng-init="item = 0">
<div class="dropdon" ng-show="item == 1">
</div>
<div class="dropdon" ng-show="item == 2">
</div>
</div>
<ul class="nav">
<li>
<div class="btn" href="#" ng-click="item = 1"
ng-class="{ active:item == 1 }"><span>Nr1</span></div>
</li>
<li>
<div class="btn" href="#" ng-click="item = 2"
ng-class="{ active:item == 2}"><span>Nr2</span></div>
</li>
At the moment it opens nicely when you first click on something and also toggles between the 2 opening but it will not close when clicking a open tba again. Also I am aware that all this logic should be in a controller but at the moment I am still a newbie on this part and would appreciate if someone could help me out with that.