Tropicalista
Tropicalista

Reputation: 3137

AngularUI bootstrap toggle selected element

I'm a noob about angular. I need a way to toggle only one element on a page.

Here is the plunker: http://plnkr.co/edit/W1eqgKiv5wv0hNkLDuzb?p=preview

If I click a button all the div are toggled/collapsed, but I need a way to collapse/toggle only the child element.

Upvotes: 2

Views: 1265

Answers (1)

msduk
msduk

Reputation: 84

How about each model div controls its own destiny...

Plunker: http://plnkr.co/edit/rBCB9CflM7TsEEK5IAk1?p=preview

<div>
  <button ng-model="collapsed1" ng-click="collapsed1 = !collapsed1">Toggle collapse</button>
  <div ng-show="collapsed1">
    <div class="well well-large">Some content</div> 
  </div>
</div>

Upvotes: 0

Related Questions