How to add icon on row in ionic framework?

2019-09-08 00:36发布

问题:

I am trying to make simple demo in ionic. I have one footer having one icon ion-compose (bottom left icon). When I click on that icon it show a pop up screen I enter name in text field and press save button. Then it generates a row which have same text as written in textfield of popup screen. I need to add icon buttons on row (like delete button, edit button). Can we add icon on dynamically generated row as I did in footer (bottom left ion-composer)?

Please add ion on row

Here is my code

http://codepen.io/anon/pen/qdEEPW

   <ion-item ng-repeat="item in items">
                {{item.testcase}}
                <ion-reorder-button class="ion-navicon"></ion-reorder-button>

            </ion-item>

please press bottom button on left side of footer .when click it show pop up snd fill entry it generate the row.I need to add icons on row I will show the image what i want I need delete icon and edit button icon on row..you can choose amy icon from this link http://ionicons.com/

回答1:

Related: how to add icons in row which is generated dynamically in ionic

icons added. You will have to add the functions for the buttons.

HTML:

    <ion-item ng-repeat="item in items">
        {{item.testcase}}
      <button class="button {{item.close}}"></button>
      <button class="button {{item.edit}}"></button>

JS:

myPopup.then(function(res) {
        console.log('Tapped!', res);
        if(typeof res!='undefined')
          res.edit="ion-edit";
          res.close="ion-close";
        $scope.items.push(res)

        console.log($scope.items);
    });

http://codepen.io/anon/pen/XbJJzO