如何分别使用离子列表项中的按钮和按钮和列表的perfom操作

时间:2017-09-15 10:51:40

标签: javascript html angularjs ionic-framework

我有一个列表项,其中每个列表项都有一个基于条件的按钮。如果我单击按钮它应该显示弹出窗口,如果我单击列表项它应该转到下一页但是如果我点击按钮它显示弹出窗口以及在后台它进入下一页可以有人告诉我如何处理这个。

HTML:

<ion-list class="trans-item">
        <div class="FramerList list" ng-repeat="bill in vm.bills | filter: vm.search">

          <a class="item item-icon-left" ng-if="bill.bill_paid==='true'" ng-click="vm.gotoBillDetail(bill)">
            <i class="icon ion-checkmark-circled"></i>
            {{"bno_message" | translate}} {{ bill.bill_no }}
          </a>

          <a class="item item-icon-left item-button-right" ng-if="bill.bill_paid==='false'" ng-click="vm.gotoBillDetail(bill)">
            <i class="icon ion-close-circled"></i>
            {{"bno_message" | translate}} {{ bill.bill_no }}
            <button class="button button-small billbook-button" ng-click="vm.billpaid(bill)">{{"farmerbillpaid_message" | translate}}</button>
          </a>
        </div>
    </ion-list>

1 个答案:

答案 0 :(得分:0)

您可以尝试这样的事情:

<ion-list class="trans-item">
            <div class="FramerList list" ng-repeat="bill in vm.bills | filter: vm.search">

              <a class="item item-icon-left" ng-if="bill.bill_paid==='true'" ng-click="vm.gotoBillDetail(bill)">
                <i class="icon ion-checkmark-circled"></i>
                {{"bno_message" | translate}} {{ bill.bill_no }}
              </a>

              <a class="item item-icon-left item-button-right" ng-if="bill.bill_paid==='false'" ng-click="vm.gotoBillDetail(bill)">
                <i class="icon ion-close-circled"></i>
                {{"bno_message" | translate}} {{ bill.bill_no }}                   
              </a>
 <button class="button button-small billbook-button" ng-click="vm.billpaid(bill)">{{"farmerbillpaid_message" | translate}}</button>
            </div>
        </ion-list>