2016-06-01 41 views
0

我想让两个显示/隐藏按钮的列表中的两个列说A和B ..按钮a和b分别正常工作,但如果我在表中使用两个...其中只有一个功能正常的其他什么都不做..请血症我,我是新来这个桌上的角度ngif按钮

<table datatable="ng" class="row-border hover table table-condensed no-margin"> 
        <thead> 
         <tr> 
          <th>#</th> 
          <th>Username</th>> 
          <th>Profile</th> 
          <th>Points</th> 
          <th>Forcasts Won/Lost</th> 
          <th>Invites</th> 
          <th>Referrals</th> 
          <th>Activity</th> 
          <th>Most Used Redeemption Gateway</th> 
          <th>Most Read FAQ</th> 
          <th>Promo Codes used</th> 
          <th>Suspend/Unsuspend</th> 
         </tr> 
        </thead> 
        <tbody> 
         <tr ng-repeat-start="person in showCase.persons"> 
          <td>{{person.id}}</td> 
          <td>{{person.uname}}</td> 
          <td> 
           <button type="button" class="btn btn-primary" ng-if="person.Profexpanded" ng-click="person.Profexpanded = false;person.Invexpanded=false">Hide</button> 
           <button type="button" class="btn btn-primary" ng-if="!person.Profexpanded" ng-click="person.Profexpanded = true;person.Invexpanded=false">Show</button> 
          </td> 
          <td>{{person.points}}</td> 
          <td>{{person.forcasts}}</td> 
          <td style="padding:5px"> 
           <table><tbody> 
           <tr><td><b>sent: </b></td> <td>{{person.invites[0].sent}}</td></tr> 
           <tr><td><b>accepted:</b></td> <td>{{person.invites[0].accepted}}</td></tr> 
           </tbody></table> 
          </td> 
          <td>{{person.referrals}}</td> 
          <td> 
           <button type="button" class="btn btn-primary" ng-if="person.Invexpanded" ng-click="person.Invexpanded = false;person.Profexpanded = false">Hide</button> 
           <button type="button" class="btn btn-primary" ng-if="!person.Invexpanded" ng-click="person.Invexpanded = true;person.Profexpanded = false">Show</button> 
          </td> 
          <td>{{person.muredempt}}</td> 
          <td>{{person.mfaq}}</td> 
          <td>{{person.promocodes}}</td> 
          <td>{{person.isSuspended}}</td> 
         </tr> 
         <tr ng-if="person.Profexpanded" ng-repeat-end=""> 
          <td class = "profile" colspan="5"> 
           Hello A 
          </td> 
         </tr> 
         <tr ng-if="person.Invexpanded" ng-repeat-end=""> 
          <td>Hello B</td> 
         </tr> 
        </tbody> 
       </table> 
       <!--end .card-body --> 
      </div>` 

回答

0

也许尝试ng-show代替ng-if<tr ng-show="person.Invexpanded" ng-repeat-end="">

+0

不工作兄弟仍然是相同的结果..如果我把B的行之前A然后B将开始工作,A将停止工作 – Rohit

0

使用 <tr ng-if="person.Profexpanded"> 而不是 <tr ng-if="person.Profexpanded" ng-repeat-end="">