angularjs - Angular JS "Collapse" | Closed view by default -


i'm building accordion , came across bootstrap's "collapse".

collapse="iscollapsed" 

when load page, "shared connections" panel open default, i'm wanting have panels "shared connections" & "other connections" closed default until user interacts them.

through research far, haven't seen done.

here code:

<div class="col-xs-12">                       <div class="connections-wrap" ng-click="iscollapsed = !iscollapsed">                         <span class="connection-amount">3</span>                         <span class="connection-type">shared connections</span>                         <i class="vf-i"></i>                       </div>                       <ul class="connections-list" collapse="iscollapsed">                         <li>                           <span class="connection-device">eddie benson tablet</span>                           <span class="connection-number">021 019 17338</span>                         </li>                         <li>                           <span class="connection-device">eddie work phone</span>                           <span class="connection-number">021 019 17343</span>                         </li>                         <li>                           <span class="connection-device">eddie work android</span>                           <span class="connection-number">021 019 17339</span>                         </li>                       </ul>                       <div class="connections-wrap">                         <span class="connection-amount">2</span>                         <span class="connection-type">other connections</span>                         <i class="vf-i"></i>                       </div>                     </div>  

here solution - required ng-init="true" collapse isn't being initialised on load.

ng-init="iscollapsed = true" 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -