如何在离子中动态生成的行中添加图标 [英] how to add icons in row which is generated dynamically in ionic

查看:25
本文介绍了如何在离子中动态生成的行中添加图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 ionic 中制作简单的演示.我有一个页脚有一个图标 ion-compose(左下角图标).当我点击那个图标时,它会显示一个我输入的弹出屏幕在文本字段中命名,然后按 save 按钮.然后它生成一行,其文本与弹出屏幕的文本字段中写入的文本相同.我需要在行上添加图标按钮(如删除按钮、编辑按钮).我们可以像在页脚(左下角离子组合器)中那样在动态生成的行上添加图标吗?请在行上添加离子

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 generate 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

这是我的代码

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

推荐答案

您将必须能够修改他们的框架,以从 items 对象中获取新的键/值,并将其传递给它赋予 div 的类.

you will have to be able to modify their framework to take a new key/value from the items object and pass it to the class that it gives the div.

res.class="icon-class";
$scope.items.push(res)

我修改了您的 codepen 以显示您可以将 items 对象传递给类键/值http://codepen.io/anon/pen/XbJJzO

I modified your codepen to show you can pass the items object a class key/value http://codepen.io/anon/pen/XbJJzO

这篇关于如何在离子中动态生成的行中添加图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆