简体   繁体   中英

How to Show/Hide buttons with Angular-UI static tabs

I need to Hide/Show different Buttons when a second tab is clicked, and the same when the default tab is clicked

plubkr

 <tabset>
<tab heading="Home" select="showme=true"></tab>
<tab heading="Detail" select="showme=true"></tab>
 </tabset>
<div>
<input ng-hide="showme"  type="button" value="Update Home"/>
<input ng-hide="showme" type="submit" value="Save Home"/>

<input ng-show ="showme" type="button" value="Update Detail"/>
<input ng-show="showme"  type="submit" value="Save Detail" />
 </div>

Put the content of the tab inside the <tab> and remove the ng-hide / ng-show :

<tabset>
  <tab heading="Home" select="showme=true">

    <input type="button" value="Update Home"/>
    <input type="submit" value="Save Home"/>

  </tab>
  <tab heading="Detail" select="showme=true">

    <input type="button" value="Update Detail"/>
    <input type="submit" value="Save Detail" />

  </tab>
</tabset>

Updated plunker

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM